Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral_child.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java
===================================================================
diff -u -r26921 -r29584
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java (.../DepartmentMonthDetailItem.java) (revision 26921)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java (.../DepartmentMonthDetailItem.java) (revision 29584)
@@ -46,7 +46,10 @@
* 供应商 主要显示一次性物品和外来器械的供应商
*/
private String supplierName;
-
+ /**
+ * 积分
+ */
+ private Double integral = 0.00;
public String getGoodsName() {
return goodsName;
}
@@ -165,5 +168,13 @@
public void setSpecification(String specification) {
this.specification = specification;
}
+
+ public Double getIntegral() {
+ return integral;
+ }
+
+ public void setIntegral(Double integral) {
+ this.integral = integral;
+ }
}
Index: ssts-web/src/main/webapp/jasperRtp/monthIntegralReport.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/monthIntegralReport.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/monthIntegralReport.jrxml (revision 29584)
@@ -0,0 +1,372 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/monthIntegralReport.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js
===================================================================
diff -u -r28304 -r29584
--- ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 28304)
+++ ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 29584)
@@ -108,7 +108,9 @@
showSupplierNameInDetailedAccountingMonthlyReport = true;
}
var enableDiscountPrice = sstsConfig.enableDiscountPrice;
- if("singleDepart" == patternOfReport){//单个科室的明细核算月报
+ if('standard' == patternOfReport && sstsConfig.enableToussePointsStatistics){
+ jasperreportFileName = "DepartmentMonthDetailIntegral.jasper";
+ }else if("singleDepart" == patternOfReport){//单个科室的明细核算月报
if(departSearch == '' || departCoding == ''){
showResult('单个科室的明细核算月报必须选择科室');
Ext.getCmp('departSearch').focus();
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java
===================================================================
diff -u -r29439 -r29584
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 29439)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 29584)
@@ -330,7 +330,7 @@
break;
}
}
- if("statisticalWorkload".equals(reportName)){//数字单元格内容设置右边距
+ if("statisticalWorkload".equals(reportName) || "monthReport".equals(reportName)){//对于这些报表 数字单元格内容设置右边距
for (int i = 0; i < size; i++) {
JRPrintElement jr = jRPrintElements.get(i);
if(!(jr instanceof JRTemplatePrintFrame)){
@@ -355,7 +355,7 @@
continue;
}
JRTemplatePrintText kItemText = (JRTemplatePrintText)kItem;
- if(StringUtils.isNotBlank(kItemText.getText()) && StringUtils.isNumeric(kItemText.getText())){
+ if(StringUtils.isNotBlank(kItemText.getText()) && StringTools.isNumber(kItemText.getText())){
kItemText.getLineBox().setRightPadding(8);
}
}
@@ -741,6 +741,7 @@
tousseType, disposableGoodsType,
showCustonTousseAmount, patternOfReport);
}
+ parametMap.put("totalIntegral", getTotalIntegral(dataSource));//设置积分
boolean applyMonthReportOneColumnTemplate = CssdUtils
.getSystemSetConfigByNameBool("applyMonthReportOneColumnTemplate");
// 核算月报的价格列在最右边
@@ -1626,8 +1627,24 @@
}
return damageBeans;
}
-
/**
+ * 核算月报从数据源中计算积分
+ * @param dataSource 数据源
+ */
+ private Double getTotalIntegral(List dataSource){
+ boolean enableToussePointsStatistics = CssdUtils.getSystemSetConfigByNameBool("enableToussePointsStatistics", false);
+ if(!enableToussePointsStatistics || CollectionUtils.isEmpty(dataSource)){
+ return 0.00;
+ }
+ Double totalIntegral = 0.00;
+ for (MonthReportBean monthReportBean : dataSource) {
+ if(monthReportBean.getIntegral() != null && monthReportBean.getIntegral() != 0.00){
+ totalIntegral += monthReportBean.getIntegral().doubleValue();
+ }
+ }
+ return totalIntegral;
+ }
+ /**
* 获取材料报损数据
* @return
*/
Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral_child.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral_child.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral_child.jrxml (revision 29584)
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral.jrxml (revision 29584)
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/disinfectsystem/config/fsszyy/config.js
===================================================================
diff -u -r28725 -r29584
--- ssts-web/src/main/webapp/disinfectsystem/config/fsszyy/config.js (.../config.js) (revision 28725)
+++ ssts-web/src/main/webapp/disinfectsystem/config/fsszyy/config.js (.../config.js) (revision 29584)
@@ -167,5 +167,7 @@
//按科室打印回收申请单
printRecyclingDetailWithDepartGroup:true ,
//科室申请数量干预功能
- enableInterfereApplyAmount:true
+ enableInterfereApplyAmount:true,
+ //启用器械包积分统计功能
+ enableToussePointsStatistics:true
}
\ No newline at end of file
Index: ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/importbasedata/service/ImportBasedataManagerImpl.java
===================================================================
diff -u -r28947 -r29584
--- ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/importbasedata/service/ImportBasedataManagerImpl.java (.../ImportBasedataManagerImpl.java) (revision 28947)
+++ ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/importbasedata/service/ImportBasedataManagerImpl.java (.../ImportBasedataManagerImpl.java) (revision 29584)
@@ -4171,6 +4171,9 @@
if(StringUtils.isNotBlank(ttd.getIsCleanedEntirely())){
persistenceTousseDefinition.setIsCleanedEntirely(ttd.getIsCleanedEntirely());
}
+ if(ttd.getIntegral() != null){
+ persistenceTousseDefinition.setIntegral(ttd.getIntegral());
+ }
if(StringUtils.isNotBlank(ttd.getPackageType())){
persistenceTousseDefinition.setPackageType(ttd.getPackageType());
}
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java
===================================================================
diff -u -r29571 -r29584
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 29571)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 29584)
@@ -3415,16 +3415,25 @@
}
}
}
-
- //器械包(含消毒物品、敷料包等)发货数量统计
+ boolean enableToussePointsStatistics = CssdUtils.getSystemSetConfigByNameBool("enableToussePointsStatistics", false);
+ //器械包(含消毒物品、敷料包等)发货数量统计
if(StringUtils.isBlank(tousseType) || (!"器械材料".equals(tousseType) && !TousseItem.TYPE_DIPOSABLE_GOODS.equals(tousseType) && !TYPE_AUTO_DEDUCTION.equals(tousseType))){
String columnSqlForInvoiceAmountSql = null;
String leftJoinSqlForInvoiceAmountSql = null;
if(dataSoureOfMaterialsCountOfToussesInReports == 3){
- columnSqlForInvoiceAmountSql = "ii.materialAmount,td.isApplyEntireTousse";
+ if(enableToussePointsStatistics){
+ columnSqlForInvoiceAmountSql = "ii.materialAmount,td.isApplyEntireTousse,td.integral ";
+ }else{
+ columnSqlForInvoiceAmountSql = "ii.materialAmount,td.isApplyEntireTousse";
+ }
leftJoinSqlForInvoiceAmountSql = "left join TousseDefinition td on ii.tousseDefinitionId=td.id";
}else{
- columnSqlForInvoiceAmountSql = "tdm.materialAmount,tdm.isApplyEntireTousse ";
+ if(enableToussePointsStatistics){
+ tousseDefinitionIdMaterialAmountSql = " (select sum(mi.count) materialAmount,td.id,td.tousseType,td.isApplyEntireTousse,td.integral from MaterialInstance mi join TousseDefinition td on mi.tousse_id = td.id group by td.id,td.tousseType,isApplyEntireTousse,td.integral) ";
+ columnSqlForInvoiceAmountSql = "tdm.materialAmount,tdm.isApplyEntireTousse,tdm.integral ";
+ }else{
+ columnSqlForInvoiceAmountSql = "tdm.materialAmount,tdm.isApplyEntireTousse ";
+ }
leftJoinSqlForInvoiceAmountSql = " left join " + tousseDefinitionIdMaterialAmountSql + " tdm on tdm.id = ii.tousseDefinitionId ";
}
String invoiceAmountSql = "select i.settleAccountsDepartCoding as coding,i.settleAccountsDepart "
@@ -3438,8 +3447,10 @@
+ " and (i.status ='收货签收' or i.status = '已发货') " + invoiceWheresql;
//如果为高值耗材处理科室用户,并且启用高值耗材功能,且所选物品类型为全部或高值耗材时,则将高值耗材退货数据也抵冲掉
if(enableExpensiveGoods && (StringUtils.isBlank(tousseType) || StringUtils.equals(ExpensiveGoods.TYPE_NAME, tousseType))){
+ String queryIntegralSql = enableToussePointsStatistics?",0.0 as integral":"";
invoiceAmountSql += " union all (select i.settleAccountsDepartCoding coding,i.settleAccountsDepart depart,-1 * count(egi.id) as amount,'高值耗材' as tousseType,"
+ " null as materialAmount,null as isApplyEntireTousse "
+ + queryIntegralSql
+ " from ExpensiveGoodsGodownEntry egge join ExpensiveGoodsGodownEntryItem eggei on egge.id=eggei.expensiveGoodsGodownEntry_id "
+ " join ExpensiveGoodsInstance egi on egi.id=eggei.expensiveGoodsInstanceId join Invoice i on egi.invoiceId=i.id "
+ " where " + getHandleDeptCodeSql("i.orgUnitCoding") + " and egge.type='退库单' " + expensiveGoodsWheresql
@@ -3455,6 +3466,13 @@
String tousseTypeName = rs2.getString(4);
int materialAmount = rs2.getInt("materialAmount");
String isApplyEntireTousse = rs2.getString("isApplyEntireTousse");
+ Double integral = null;
+ if(enableToussePointsStatistics && tousseAmount != null && tousseAmount.doubleValue() != 0.00){
+ Number integralNum = (Number)rs2.getObject("integral");
+ if(integralNum != null){
+ integral = integralNum.doubleValue() * tousseAmount;
+ }
+ }
Double totalMaterialAmount = tousseAmount * materialAmount;
// 如果是消毒物品,用统计数量替换包数量
if ("消毒物品".equals(tousseTypeName) && Constants.STR_NO.equals(isApplyEntireTousse)) {
@@ -3466,16 +3484,14 @@
tousseAmount = totalMaterialAmount;
}
}
- //if(tousseAmount > 0){
- if(ExpensiveGoods.TYPE_NAME.equals(tousseTypeName)){
- newMonthReport(code, dept,"3","数量统计", "高值耗材数量",tousseAmount,list);
- }else{
- newMonthReport(code, dept,"3","数量统计", "器械包数量",tousseAmount,list);
- if(monthReportMaterialAmountOfTousse){
- newMonthReport(code, dept, "4", "包内材料统计", "包内材料数量", totalMaterialAmount, list);
- }
+ if(ExpensiveGoods.TYPE_NAME.equals(tousseTypeName)){
+ newMonthReport(code, dept,"3","数量统计", "高值耗材数量",tousseAmount,list,integral);
+ }else{
+ newMonthReport(code, dept,"3","数量统计", "器械包数量",tousseAmount,list,integral);
+ if(monthReportMaterialAmountOfTousse){
+ newMonthReport(code, dept, "4", "包内材料统计", "包内材料数量", totalMaterialAmount, list,integral);
}
- //}
+ }
}
} catch (SQLException e) {
e.printStackTrace();
@@ -4769,7 +4785,21 @@
bean.setMoney(money);
list.add(bean);
}
-
+ private void newMonthReport(String code, String dept,
+ String columnNum, String columnTitle, String columnName,
+ Double money,List list, Double integral) {
+ MonthReportBean bean = new MonthReportBean();
+ bean.setRowNum(code);
+ bean.setDepartment(dept);
+ bean.setColumnNum(columnNum);
+ bean.setColumnTitle(columnTitle);
+ bean.setColumnName(columnName);
+ bean.setMoney(money);
+ if(integral != null){
+ bean.setIntegral(integral);
+ }
+ list.add(bean);
+ }
public Map getDiposableGoodsManufacturer(){
String sql = "select dg.name,dg.specification,db.batchNumber,db.manufacturer "
+ "from " + DisposableGoodsStock.class.getSimpleName() + " dg," + DisposableGoodsBatchStock.class.getSimpleName() + " db where dg.id = db.diposablegoods_id";
@@ -4926,19 +4956,26 @@
departCoding = AcegiHelper.getCurrentOrgUnitCode();
}
}
+ boolean enableToussePointsStatistics = CssdUtils.getSystemSetConfigByNameBool("enableToussePointsStatistics", false);
List datas = new ArrayList();
List allTousseType = getTousseTypes(typeSearch);
// 查看是否配置显示供应商
Boolean showSupplierNameInDetailedAccountingMonthlyReport = CssdUtils.getSystemSetConfigByNameBool("showSupplierNameInDetailedAccountingMonthlyReport", false);
String tousseDefinitionOfSupplierNameSql = "";//用器械包定义里的供应商拼接的sql语句,主要用于查询供应商和按供应商分组
- String addTousseDefinitionAtWhere = "";//拼接sql,用于添加查询TousseDefinition表
- String addJoinTousseDefinitionSql = "";//用于连接InvoiceItem和TousseDefinition
+ String addTousseDefinitionAtWhere = "";//拼接sql,用于添加查询TousseDefinition
String dgbsOfSupplierNameSql = "";//用于查询DisposableGoodsBatchStock或DisposableGoodsBatch的供应商名称,主要用于查询供应商和按供应商分组
String noQuerySupplierName = "";//不需要查询器械包名称的sql,用于连接union all连接表时保持列数不变
+ String integralOftousseDefinitionSql = "";
+ String noQueryIntegralSql = "";
+ if(enableToussePointsStatistics){
+ addTousseDefinitionAtWhere = " left join TousseDefinition td on td.id = ii.tousseDefinitionId ";
+ integralOftousseDefinitionSql = ",td.integral ";
+ noQueryIntegralSql = ",0 integral ";
+ }else if(showSupplierNameInDetailedAccountingMonthlyReport){
+ addTousseDefinitionAtWhere = " join TousseDefinition td on td.id = ii.tousseDefinitionId ";
+ }
if(showSupplierNameInDetailedAccountingMonthlyReport){
tousseDefinitionOfSupplierNameSql = " ,td.supplierName ";
- addTousseDefinitionAtWhere = ",TousseDefinition td ";
- addJoinTousseDefinitionSql = " and td.id = ii.tousseDefinitionId ";
dgbsOfSupplierNameSql = " ,dgbs.supplierName ";
noQuerySupplierName = ",''";
}
@@ -5242,23 +5279,22 @@
String returnGoodsTousseType = " CASE rr.type WHEN '一次性物品' THEN (rr.type) WHEN '器械包' THEN (td.toussetype) ELSE rr.type END ";
String returnGoodsTousseDefinitionId = " CASE rr.type WHEN '器械包' THEN ri.tousseDefinition_id ELSE 0 END ";
//器械包
- String tousseSql = " (select i.settleAccountsDepart "+ tousseDefinitionOfSupplierNameSql +",ii.tousseName as name,sum(ii.amount) as amount,"
+ String tousseSql = " (select i.settleAccountsDepart "+ tousseDefinitionOfSupplierNameSql + integralOftousseDefinitionSql +",ii.tousseName as name,sum(ii.amount) as amount,"
+"sum(ii.settlementPrice) as settlementprice,sum(ii.settlementDiscountPrice) as settlementDiscountPrice,ii.tousseType as type"
- + ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId from invoice i,InvoiceItem ii "
+ + ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId from invoice i"
+ + " join InvoiceItem ii on i.id = ii.invoice_id "
+ addTousseDefinitionAtWhere
- + " where i.id = ii.invoice_id "
- + addJoinTousseDefinitionSql
- + " and ii.diposable = '否' and ii.expensiveGoodsInstanceId is null and "+getHandleDeptCodeSql("i.orgUnitCoding")+" "
+ + " where ii.diposable = '否' and ii.expensiveGoodsInstanceId is null and "+getHandleDeptCodeSql("i.orgUnitCoding")+" "
+ monthFilterSql
+ departFilterSql
+ typeFilterSql
+ goodsNameFilterSql
- + " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType,ii.tousseName,ii.tousseDefinitionId " + tousseDefinitionOfSupplierNameSql + ")";
+ + " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType,ii.tousseName,ii.tousseDefinitionId " + tousseDefinitionOfSupplierNameSql + integralOftousseDefinitionSql + ")";
//新的高值耗材(发货)
String selectExpensiveGoodsSql = "";
//如果有启用高值耗材则查询
if(enableExpensiveGoods){
- selectExpensiveGoodsSql = " union all (select i.settleAccountsDepart"+noQuerySupplierName+",case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end as name,sum(ii.amount) as amount,"
+ selectExpensiveGoodsSql = " union all (select i.settleAccountsDepart"+noQuerySupplierName + noQueryIntegralSql +",case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end as name,sum(ii.amount) as amount,"
+"sum(ii.settlementPrice) as settlementprice,sum(ii.settlementDiscountPrice) as settlementDiscountPrice,ii.tousseType as type"
+ ",'' as batchNumber,ei.expDate as expDate,0 as tousseDefinitionId from " + Invoice.class.getSimpleName() + " i join "
+ InvoiceItem.class.getSimpleName()+" ii on i.id = ii.invoice_id join " + ExpensiveGoodsInstance.class.getSimpleName()
@@ -5272,7 +5308,7 @@
+ goodsNameFilterSql
+ " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType,case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end,ii.expensiveGoodsInstanceId,ei.expDate)";
//新的高值耗材(一键退库-即退货),如果所选物品类型为全部或高值耗材时,
- selectExpensiveGoodsSql += " union all (select i.settleAccountsDepart "+ noQuerySupplierName+",case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end as name,-1 * count(egi.id) as amount,-1 * sum(egi.price) settlementprice,-1 * sum(egi.price) settlementprice,'高值耗材' as type,null as batchNumber,egi.expDate,null as tousseDefinitionId "
+ selectExpensiveGoodsSql += " union all (select i.settleAccountsDepart "+ noQuerySupplierName + noQueryIntegralSql +",case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end as name,-1 * count(egi.id) as amount,-1 * sum(egi.price) settlementprice,-1 * sum(egi.price) settlementprice,'高值耗材' as type,null as batchNumber,egi.expDate,null as tousseDefinitionId "
+ " from ExpensiveGoodsGodownEntry egge join ExpensiveGoodsGodownEntryItem eggei on egge.id=eggei.expensiveGoodsGodownEntry_id "
+" join ExpensiveGoodsInstance egi on egi.id=eggei.expensiveGoodsInstanceId "
+" join Invoice i on egi.invoiceId=i.id "
@@ -5292,7 +5328,7 @@
diposableGoodsTousseTypeSql = String.format(" and d.type='%s' ", InvoiceItem.TYPE_AUTO_DEDUCTION);
}
if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(typeSearch) || "高值耗材".equals(typeSearch) && !enableExpensiveGoods || TYPE_AUTO_DEDUCTION.equals(typeSearch)){
- diposableGoodsSql = " union all (select i.settleaccountsdepart "+ dgbsOfSupplierNameSql +",d.name as name,sum(d.amount) as amount,"
+ diposableGoodsSql = " union all (select i.settleaccountsdepart "+ dgbsOfSupplierNameSql+noQueryIntegralSql +",d.name as name,sum(d.amount) as amount,"
+"sum(d.fluctuationPrice*d.amount) as settlementprice,sum(d.fluctuationPrice*d.amount) as settlementDiscountPrice,'一次性物品' as type"
+ ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from invoice i,DiposableGoodsItem d," + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs "
+ " where i.id = d.invoice_id and d.disposableGoodsBatchStockID=dgbs.id and "+getHandleDeptCodeSql("i.orgUnitCoding")+" "
@@ -5307,7 +5343,7 @@
String packingDisposableGoodsSql = " ";
{
if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(typeSearch)){
- packingDisposableGoodsSql = " union all (select pr.orgUnitName "+ dgbsOfSupplierNameSql +",dgi.name as name,sum(dgi.amount) as amount,"
+ packingDisposableGoodsSql = " union all (select pr.orgUnitName "+ dgbsOfSupplierNameSql + noQueryIntegralSql +",dgi.name as name,sum(dgi.amount) as amount,"
+"sum(dgi.fluctuationPrice*dgi.amount) as settlementprice,sum(dgi.fluctuationPrice*dgi.amount) as settlementDiscountPrice,'一次性物品' as type"
+ ",dgi.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from PackingRecord pr inner join DiposableGoodsItem dgi on pr.id = dgi.packingRecordId "
+ " inner join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on dgi.disposableGoodsBatchStockID=dgbs.id"
@@ -5329,7 +5365,7 @@
if(StringUtils.isBlank(batch)){
if ((StringUtils.isBlank(typeSearch) || "器械材料".equals(typeSearch) || "高值耗材".equals(typeSearch))) {
// 材料发货
- materialInvoiceSql = " union all (select i.settleAccountsDepart "+ noQuerySupplierName +",case when td.name is null then ii.materialName else ii.materialName "+ concatSymbolInDb +"'('"+ concatSymbolInDb +" td.name "+ concatSymbolInDb +"')' end,sum(ii.amount),sum(ii.settlementPrice),"
+ materialInvoiceSql = " union all (select i.settleAccountsDepart "+noQuerySupplierName + noQueryIntegralSql +",case when td.name is null then ii.materialName else ii.materialName "+ concatSymbolInDb +"'('"+ concatSymbolInDb +" td.name "+ concatSymbolInDb +"')' end,sum(ii.amount),sum(ii.settlementPrice),"
+"sum(ii.settlementPrice) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,td.id as tousseDefinitionId "
+ " from MaterialInvoiceItem ii"
+ " left join TousseDefinition td on td.id= ii.tousseDefinitionId "
@@ -5343,7 +5379,7 @@
+ " group by i.settleaccountsdepart,case when td.name is null then ii.materialName else ii.materialName "+ concatSymbolInDb +" '(' "+ concatSymbolInDb +" td.name "+ concatSymbolInDb +"')' end,td.id) ";
}
// 材料退货
- materialReturnSql = " union all (select rr.depart as settleaccountsdepart "+ noQuerySupplierName+",ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice),"
+ materialReturnSql = " union all (select rr.depart as settleaccountsdepart "+ noQuerySupplierName + noQueryIntegralSql +",ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice),"
+"-sum(ii.settlementPrice) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ " from ReturnMaterialRecord rr,materialDefinition d,"
+ "ReturnMaterialItem ii where rr.id = ii.returnMaterialRecord_ID "
@@ -5354,7 +5390,7 @@
+ materialTypeFilterSql
+ " group by rr.depart,ii.materialName) ";
- lostMaterial = " union all (select r.depart "+noQuerySupplierName+",r.materialName,sum(r.additionalAmount),sum(r.additionalAmount * r.materialCost),"
+ lostMaterial = " union all (select r.depart "+noQuerySupplierName + noQueryIntegralSql +",r.materialName,sum(r.additionalAmount),sum(r.additionalAmount * r.materialCost),"
+"sum(r.additionalAmount * r.materialCost) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ " from MaterialErrorDamageDetail r left join materialDefinition m on r.materialDefinitionId = m.id where 1=1 and r.errorType = '缺失' and r.type = '"+MaterialErrorDamageDetail.TYPE_ERROR+"' and r.materialName != '器械包标识牌' and r.additionalAmount > 0 and "+getHandleDeptCodeSql("r.handleDepartCode")+" "
+ lostMaterialFilterSql + "group by r.depart,r.materialName ) ";
@@ -5366,15 +5402,15 @@
if(Constants.STR_YES.equals(damagedTousseAtCost)){
banQuery = "";
}
- damageMaterial = " union all (select i.depart"+noQuerySupplierName+",i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),"
+ damageMaterial = " union all (select i.depart"+noQuerySupplierName + noQueryIntegralSql +",i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),"
+"sum(i.materialCost*i.additionalAmount) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ "from MaterialErrorDamageDetail i left join materialDefinition m on i.materialDefinitionId = m.id where 1=1 "
+ banQuery
+ " and i.type = '" + MaterialErrorDamageDetail.TYPE_DAMAGE + "' and i.additionalAmount > 0 and "+getHandleDeptCodeSql("i.handleDepartCode")+" " + damageFilterSql
+ " group by i.departCode,i.depart,i.materialName ) ";
}
//退货(一次性物品、器械包)
- String returnGoodsSql = " union all (select rr.depart as settleaccountsdepart"+dgbsOfSupplierNameSql+",ri.toussename as name,"
+ String returnGoodsSql = " union all (select rr.depart as settleaccountsdepart"+dgbsOfSupplierNameSql + noQueryIntegralSql+",ri.toussename as name,"
+ "-sum(ri.amount) as amount,-sum(ri.settlementPrice) as settlementprice,-sum(ri.settlementPrice) as settlementDiscountPrice,"
+returnGoodsTousseType+" as type"
+ ",ri.batchNumber as batchNumber,dgbs.expDate,"+returnGoodsTousseDefinitionId+" as tousseDefinitionId from " + ReturnGoodsRecord.class.getSimpleName() + " rr inner join "
@@ -5390,7 +5426,7 @@
if(TYPE_AUTO_DEDUCTION.equals(typeSearch)){
supplyRoomTousseTypeSql = String.format(" and rr.type='%s' ", InvoiceItem.TYPE_AUTO_DEDUCTION);
}
- String supplyRoomDiposableGoodsSql = " union all (select rr.depart"+ dgbsOfSupplierNameSql +" as settleaccountsdepart,rri.goodsName,sum(rri.amount),"
+ String supplyRoomDiposableGoodsSql = " union all (select rr.depart"+ dgbsOfSupplierNameSql +" as settleaccountsdepart"+ noQueryIntegralSql +",rri.goodsName,sum(rri.amount),"
+"sum(rri.price*rri.amount) as settlementprice,sum(rri.price*rri.amount) as settlementDiscountPrice,rri.type as type,dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId "
+" from ReceiveRecord rr,ReceiveRecordItem rri left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs "
+" on rri.diposableGoodBatchStock_id = dgbs.id left join DisposableGoods d on d.id = rri.disposableGoodsId where rr.id = rri.receiveRecord_id and "+getHandleDeptCodeSql("rr.departCoding")+" "
@@ -5400,15 +5436,15 @@
+ supplyRoomDiposableGoodsFilterSql
+ " group by rr.depart,rri.goodsName,rri.amount,rri.type,dgbs.batchNumber,dgbs.expDate "+ dgbsOfSupplierNameSql +") ";
// 调拨出库
- String appropriateOutDiposableGoodsSql = " union all (select oge.targetOrgUnitName as settleaccountsdepart"+dgbsOfSupplierNameSql+",ged.goodsName,sum(ged.amount),"
+ String appropriateOutDiposableGoodsSql = " union all (select oge.targetOrgUnitName as settleaccountsdepart"+dgbsOfSupplierNameSql+noQueryIntegralSql+",ged.goodsName,sum(ged.amount),"
+"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type,dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId "
+" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgbs on ged.disposableGoodsBatchID=dgbs.id inner join DisposableGoods dg on dgbs.diposablegoods_id = dg.id "
+" where oge.type ='退库单' and oge.subType='调拨出库' and "+getHandleDeptCodeSql("oge.orgUnitCode")+" "
+outEntryFilterSql
+" and "+outEntryPredicate
+ " group by oge.targetOrgUnitName, ged.goodsName,dgbs.batchNumber,dgbs.expDate "+ dgbsOfSupplierNameSql +") ";
// 盘亏出库
- String stocktakeOutDiposableGoodsSql = " union all (select oge.orgUnitName"+dgbsOfSupplierNameSql+" as settleaccountsdepart,ged.goodsName,sum(ged.amount),"
+ String stocktakeOutDiposableGoodsSql = " union all (select oge.orgUnitName"+dgbsOfSupplierNameSql+" as settleaccountsdepart"+ noQueryIntegralSql +",ged.goodsName,sum(ged.amount),"
+"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type,dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId "
+" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgbs on ged.disposableGoodsBatchID=dgbs.id inner join DisposableGoods dg on dgbs.diposablegoods_id = dg.id "
+" where oge.type ='退库单' and oge.subType='盘亏出库' and "+getHandleDeptCodeSql("oge.orgUnitCode")+" "
@@ -5444,12 +5480,12 @@
}
}
if(TYPE_CHARGE.equals(typeSearch)){
- String chargeSql = String.format(" select ci.orgUnitName settleAccountsDepart,chargeItem name,1 amount,price settlementprice,0 settlementDiscountPrice,'收费项目' type ,'' batchNumber,NULL as expDate ,null as tousseDefinitionId "
+ String chargeSql = String.format(" select ci.orgUnitName settleAccountsDepart"+ noQueryIntegralSql +",chargeItem name,1 amount,price settlementprice,0 settlementDiscountPrice,'收费项目' type ,'' batchNumber,NULL as expDate ,null as tousseDefinitionId "
+ " from ChargeRecordItem ci inner join ChargeRecord cr on cr.id=ci.chargeRecord_id where 1=1 %s %s %s group by ci.orgUnitName,chargeItem,price,chargeTime "
, chargeDepartSql,chargeDateSql,chargeItemSql);
sql = chargeSql;
}else if(TYPE_ALL.equals(typeSearch) || StringUtils.isBlank(typeSearch)){
- sql += String.format(" union all select ci.orgUnitName settleAccountsDepart,chargeItem name,1 amount,price settlementprice,0 settlementDiscountPrice,'收费项目' type ,'' batchNumber,NULL as expDate ,null as tousseDefinitionId "
+ sql += String.format(" union all select ci.orgUnitName settleAccountsDepart"+ noQueryIntegralSql +",chargeItem name,1 amount,price settlementprice,0 settlementDiscountPrice,'收费项目' type ,'' batchNumber,NULL as expDate ,null as tousseDefinitionId "
+ " from ChargeRecordItem ci inner join ChargeRecord cr on cr.id=ci.chargeRecord_id where 1=1 %s %s %s group by ci.orgUnitName,chargeItem,price,chargeTime "
, chargeDepartSql,chargeDateSql,chargeItemSql);
}
@@ -5543,6 +5579,12 @@
mdi.setExternalCode(tousseExternalCodeMap.get(goodsName));
}
}
+ if(enableToussePointsStatistics){
+ Number integralNum = (Number)rs.getObject("integral");
+ if(integralNum != null){
+ mdi.setIntegral(integralNum.doubleValue() * totalAmount);
+ }
+ }
itemList.add(mdi);
}
//统一计算要查询包定义对应的材料实例数量的DepartmentMonthDetailItem的price和totalAmount
@@ -6023,7 +6065,8 @@
//器械包
String tousseSql = " (select i.settleAccountsDepart "+ tousseDefinitionOfSupplierNameSql +",ii.tousseName as name,sum(ii.amount) as amount,"
+"sum(ii.settlementPrice) as settlementprice,sum(ii.settlementDiscountPrice) as settlementDiscountPrice,ii.tousseType as type"
- + ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId from invoice i,InvoiceItem ii "
+ + ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId "
+ + "from invoice i,InvoiceItem ii "
+ addTousseDefinitionAtWhere
+ " where i.id = ii.invoice_id "
+ addJoinTousseDefinitionSql
Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetailIntegral.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyView.js
===================================================================
diff -u -r27813 -r29584
--- ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyView.js (.../departmentMonthlyView.js) (revision 27813)
+++ ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyView.js (.../departmentMonthlyView.js) (revision 29584)
@@ -126,6 +126,8 @@
jasperreportName = "monthReportGroupByDisposableGoodsType.jasper";
}else if('accountingMonthlyReportGroupBySterilizationMode' == patternOfReport){
jasperreportName = 'monthReportGroupBySterilizationMode.jasper';
+ }else if(sstsConfig.enableToussePointsStatistics){
+ jasperreportName = "monthIntegralReport.jasper";
}else{
jasperreportName = "monthReport.jasper";
}
Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java
===================================================================
diff -u -r29517 -r29584
--- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java (.../TousseDefinitionManagerImpl.java) (revision 29517)
+++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java (.../TousseDefinitionManagerImpl.java) (revision 29584)
@@ -3192,6 +3192,7 @@
td.setIsSterile(ancestorTD.getIsSterile());
td.setIsInvoice(ancestorTD.getIsInvoice());
td.setTousseType(ancestorTD.getTousseType());
+ td.setIntegral(ancestorTD.getIntegral());
td.setBarcodePaperType(ancestorTD.getBarcodePaperType());
td.setWorkLoadStatisticalMethod(ancestorTD
.getWorkLoadStatisticalMethod());
Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java
===================================================================
diff -u -r29343 -r29584
--- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java (.../TousseDefinition.java) (revision 29343)
+++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java (.../TousseDefinition.java) (revision 29584)
@@ -676,7 +676,10 @@
* 包定义的风险级别,值为1-20的正整数,默认值为空白。(ASSJMSZXYY-37 包定义新增“风险级别”属性,以及新增《物品风险级别统计报表》)
*/
private Integer riskLevel;
-
+ /**
+ * 积分
+ */
+ private Double integral;
@Override
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@@ -2221,4 +2224,12 @@
+ ancestorID + "\", \"materialsMD5\":\"" + materialsMD5 + "\", \"isApplyEntireTousse\":\"" + isApplyEntireTousse + "\"}";
}
+ public Double getIntegral() {
+ return integral;
+ }
+
+ public void setIntegral(Double integral) {
+ this.integral = integral;
+ }
+
}
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/MonthReportBean.java
===================================================================
diff -u -r29213 -r29584
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/MonthReportBean.java (.../MonthReportBean.java) (revision 29213)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/MonthReportBean.java (.../MonthReportBean.java) (revision 29584)
@@ -27,6 +27,10 @@
* 一次性物品合计,用于贵港个性化报表总合计时减去一次性物品合计
*/
private Double sumOfDisposableGoods;
+ /**
+ * 积分
+ */
+ private Double integral = 0.0;
public String getDepartment() {
return department;
}
@@ -98,5 +102,13 @@
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
+
+ public Double getIntegral() {
+ return integral;
+ }
+
+ public void setIntegral(Double integral) {
+ this.integral = integral;
+ }
}
Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js
===================================================================
diff -u -r29374 -r29584
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 29374)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 29584)
@@ -2552,7 +2552,22 @@
name: 'maxIDCardNum',
anchor: '100%'
}]
- }, {
+ },{
+ columnWidth : colWidth,
+ layout : 'form',
+ labelWidth : fontSize == 12 ? 90 : 100,
+ labelAlign:"right",
+ hidden:!sstsConfig.enableToussePointsStatistics,
+ items:[{
+ xtype : 'numberfield',
+ fieldLabel : "积分系数",
+ allowBlank : true,
+ allowNegative:true,
+ name : 'integral',
+ id : 'integral',
+ anchor : '100%'
+ }]
+ }, {
columnWidth : 1,
layout : 'form',
labelWidth : fontSize == 12 ? 90 : 100,
@@ -3216,7 +3231,13 @@
return;
}
}
-
+ var integral = top.Ext.getCmp('integral').getValue();
+ if(integral != null && integral != ''){
+ if(integral > 10000 || integral < -10000 ){
+ showResult("积分只能是-10000.00至10000.00的数值");
+ return;
+ }
+ }
if(isExpend){
validateAndSubmit2(TousseName,isExpend);
}else{