Index: ssts-web/src/main/webapp/jasperRtp/yearWorkload.jasper =================================================================== diff -u -r14679 -r16028 Binary files differ Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r15921 -r16028 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 15921) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 16028) @@ -7804,12 +7804,13 @@ public List getYearUserWorkloadReport(String year,String querySupplyRoom) { String startDateTime = year + "-01-01 00:00:00"; - String endDateTime = (Integer.parseInt(year) + 1) + "-12-31 23:59:59"; + String endDateTime = (Integer.parseInt(year)) + "-12-31 23:59:59"; startDateTime = dateQueryAdapter.dateAdapter(startDateTime); endDateTime = dateQueryAdapter.dateAdapter(endDateTime); List list = new ArrayList(); getWorkLoad(startDateTime, endDateTime, list,querySupplyRoom); return list; + } @Override @@ -7829,89 +7830,128 @@ public void getWorkLoad(String startDateTime, String endDateTime, List list,String supplyRoom) { SupplyRoomConfig cfg = supplyRoomConfigManager.getFirstSupplyRoomConfig(); - String sql = "select '回收记录',r.recyclingUser as recyclingUser," - + "sum(t.amount)as amount from RecyclingRecord r,TousseItem t " - + "where r.id=t.recyclingRecord_id and r.recyclingTime between " - + startDateTime + " and " + endDateTime - + " and r.recyclingUser is not null" - + (dbConnection.isOracle() ? "" : " and r.recyclingUser!=''") //(陈家儒改) - + " and r.orgUnitCoding = '"+supplyRoom+"'" - + " group by r.recyclingUser" - + " union all " - + "select '清点记录',r.operator as operator," - + "sum(t.amount)as amount from RecyclingRecord r,TousseItem t " - + "where r.id=t.recyclingRecord_id and r.recyclingTime between " - + startDateTime + " and " + endDateTime - + " and r.operator is not null" - + (dbConnection.isOracle() ? "" : " and r.operator!=''") //(陈家儒改) - + " and r.orgUnitCoding = '"+supplyRoom+"'" - + " group by r.operator" - + " union all " - + "select '清洗记录',w.operator as operator,sum(w.washmaterialamount) " - + "as amount from WashAndDisinfectRecord w where w.endDate between " - + startDateTime - + " and " - + endDateTime - + " and w.operator is not null" - + (dbConnection.isOracle() ? "" : " and w.operator!=''") //(陈家儒改) - + " and w.orgUnitCoding = '"+supplyRoom+"'" - + " group by w.operator" - + " union all " - + "select '装配记录',p.packer as operator,sum(p.amount) as amount " - + "from PackingRecord p where p.packTime between " - + startDateTime - + " and " - + endDateTime - + " and p.packer is not null" - + (dbConnection.isOracle() ? "" : " and p.packer!=''") //(陈家儒改) - + " and p.orgUnitCoding = '"+supplyRoom+"'" - + " group by p.packer" - + " union all " - + "select '审核记录',t.reviewer as operator,count(*)as amount from " - + "tousseInstance t where t.reviewTime between " - + startDateTime - + " and " - + endDateTime - + " and t.reviewer is not null" - + (dbConnection.isOracle() ? "" : " and t.reviewer!=''") //(陈家儒改) - + " and t.status!= '已装配' " - + " and t.orgUnitCoding = '"+supplyRoom+"' " - + "group by t.reviewer" - + " union all " - + "select '灭菌记录',s.sterilizationUser as username,sum(s.amount)as amount " - + "from SterilizationRecord s where s.status = '灭菌完成' and s.endDate between " - + startDateTime - + " and " - + endDateTime - + " and s.sterilizationUser is not null" - + (dbConnection.isOracle() ? "" : " and s.sterilizationUser!=''") //(陈家儒改) - + " and s.orgUnitCoding = '"+supplyRoom+"' " - + "group by s.sterilizationUser" - + " union all " - + "select '发货记录',i.sender as operator,sum(t.amount) as amount from Invoice i," - + "invoiceItem t where i.id =t.invoice_id and i.sendTime between " - + startDateTime + " and " + endDateTime - + " and i.sender is not null" - + (dbConnection.isOracle() ? "" : " and i.sender!=''") //(陈家儒改) - + " and i.orgUnitCoding = '"+supplyRoom+"' group by i.sender " - + " union all " - + "select '核对记录',i.assistantSender as operator,sum(t.amount) as amount from Invoice i," - + "invoiceItem t where i.id =t.invoice_id and i.sendTime between " - + startDateTime + " and " + endDateTime - + " and i.assistantSender is not null" - + (dbConnection.isOracle() ? "" : " and i.assistantSender!=''") //(陈家儒改) - + " and i.orgUnitCoding = '"+supplyRoom+"' group by i.assistantSender "; + String betweenSql = "between "+startDateTime+" and "+endDateTime+" "; + supplyRoom = "'"+supplyRoom+"' "; + String sqlLengthFunctionName = DatabaseUtil.getSqlLengthFunctionName(dbConnection); + String sql = + "select '回收记录' type,rr.recyclingUser userName,sum(ti.amount) amount " + + "from RecyclingRecord rr " + + "inner join TousseItem ti on ti.recyclingRecord_id=rr.id " + + "where 1=1 " + + "and rr.recyclingTime " + betweenSql + + "and rr.orgUnitCoding=" + supplyRoom + + "group by rr.recyclingUser " + + + "union all " + + + "select '清点记录' type,rr.operator userName,sum(ti.amount) amount " + + "from RecyclingRecord rr " + + "inner join TousseItem ti on ti.recyclingRecord_id=rr.id " + + "where 1=1 " + + "and rr.recyclingTime " + betweenSql + + "and rr.orgUnitCoding=" + supplyRoom + + "group by rr.operator " + + + "union all " + + + "select '清洗记录' type,t1.userName userName,sum(t1.materialCount) amount " + + "from (" + + "select case when (cb.personInCharge is null or "+sqlLengthFunctionName+"(cb.personInCharge)=0) then wr.operator else cb.personInCharge end userName,ci.amount materialCount " + + "from WashAndDisinfectRecord wr " + + "inner join ClassifyBasket_WashRecord cw on cw.WashAndDisinfectRecord_ID=wr.id " + + "inner join ClassifyBasket cb on cb.id=cw.ClassifyBasket_ID " + + "inner join ClassifiedItem ci on ci.classifybasket_id=cb.id " + + "where 1=1 " + + "and wr.washMaterialAmount!=0 " + + "and ci.itemType = '材料' " + + "and wr.endDate " + betweenSql + + "and wr.orgUnitCoding=" + supplyRoom + + "union all " + + "select case when (cb.personInCharge is null or "+sqlLengthFunctionName+"(cb.personInCharge)=0) then wr.operator else cb.personInCharge end userName,(ci.amount*mi.count) materialCount " + + "from WashAndDisinfectRecord wr " + + "inner join ClassifyBasket_WashRecord cw on cw.WashAndDisinfectRecord_ID=wr.id " + + "inner join ClassifyBasket cb on cb.id=cw.ClassifyBasket_ID " + + "inner join ClassifiedItem ci on ci.classifybasket_id=cb.id " + + "inner join TousseDefinition td on td.id=ci.toussedefinition_id " + + "inner join MaterialInstance mi on mi.tousse_id=td.id " + + "where 1=1 " + + "and wr.washMaterialAmount!=0 " + + "and ci.itemType <> '材料' " + + "and wr.endDate " + betweenSql + + "and wr.orgUnitCoding=" + supplyRoom + + "union all " + + "select wr.operator userName,wrm.amount materialCount " + + "from WashAndDisinfectRecord wr " + + "inner join WashRecord_WashMaterial wm on wm.WashAndDisinfectRecord_ID=wr.id " + + "inner join WashAndDisinfectRecordMaterial wrm on wrm.id=wm.WashAndDisinfectMaterial_ID " + + "where 1=1 " + + "and wr.endDate " + betweenSql + + "and wr.orgUnitCoding=" + supplyRoom + + ") t1 " + + "group by t1.userName " + + + "union all " + + + "select '装配记录' type,pr.packer userName,count(*) amount " + + "from PackingRecord pr " + + "inner join TousseInstance ti on ti.packingRecord_id=pr.id " + + "where 1=1 " + + "and pr.packTime " + betweenSql + + "and pr.orgUnitCoding=" + supplyRoom + + "group by pr.packer " + + + "union all " + + + "select '审核记录' type,ti.reviewer userName,count(*) amount " + + "from tousseInstance ti " + + "where 1=1 " + + "and ti.reviewTime " + betweenSql + + "and ti.orgUnitCoding=" + supplyRoom + + "group by ti.reviewer " + + + "union all " + + + "select '灭菌记录' type,sr.sterilizationUser userName,count(*) amount " + + "from SterilizationRecord sr " + + "inner join TousseInstance ti on ti.sterilizationRecord_id=sr.id " + + "where 1=1 " + + "and sr.endDate " + betweenSql + + "and sr.orgUnitCoding=" + supplyRoom + + "group by sr.sterilizationUser " + + + "union all " + + + "select '发货记录' type,i.sender userName,sum(ii.amount) amount " + + "from Invoice i " + + "inner join InvoiceItem ii on ii.invoice_id=i.id " + + "where 1=1 " + + "and i.sendTime " + betweenSql + + "and i.orgUnitCoding=" + supplyRoom + + "group by i.sender " + + + "union all " + + + "select '核对记录' type,i.assistantSender userName,sum(ii.amount) amount " + + "from Invoice i " + + "inner join InvoiceItem ii on ii.invoice_id=i.id " + + "where 1=1 " + + "and i.sendTime " + betweenSql + + "and i.orgUnitCoding=" + supplyRoom + + "group by i.assistantSender " + ; + + String projectName = CssdUtils.getConfigProperty("project"); if("zsly".equals(projectName)){ sql += " union all " - + "select '检查数量', p.inspector,sum(p.amount) " + + "select '检查数量' type, p.inspector userName,sum(p.amount) amount " + "from PackingRecord p " + "where p.packtime between "+startDateTime+" and "+ endDateTime + " and p.inspector is not null and p.inspector!='' and p.orgunitcoding = '"+cfg.getOrgUnitCoding()+"' group by p.inspector " + " union all " - + "select '包装数量',p.wrapper,sum(p.amount) " + + "select '包装数量' type,p.wrapper userName,sum(p.amount) amount " + "from PackingRecord p " + "where p.packtime between "+startDateTime+" and "+endDateTime + " and p.wrapper is not null and p.wrapper!='' and p.orgunitcoding = '"+cfg.getOrgUnitCoding()+"' group by p.wrapper";; @@ -7922,46 +7962,50 @@ if (rs1 != null) { try { while (rs1.next()) { - String record = rs1.getString(1); - String operator = rs1.getString(2); - int amount = rs1.getInt(3); + String userName = StringTools.defaultString(rs1.getString("userName")); + if (StringUtils.isBlank(userName)) { //如果操作人为空则不统计 + continue; + } + String type = StringTools.defaultString(rs1.getString("type")); + Integer amount = rs1.getInt("amount"); + YearWorkLoad bean = new YearWorkLoad(); - bean.setOperator(operator); + bean.setOperator(userName); bean.setAmount(amount); - if("回收记录".equals(record)){ + if("回收记录".equals(type)){ bean.setColumnName("回收数量"); bean.setSequence(1); - }else if("清点记录".equals(record)){ + }else if("清点记录".equals(type)){ bean.setColumnName("清点数量"); bean.setSequence(2); - }else if("清洗记录".equals(record)){ + }else if("清洗记录".equals(type)){ bean.setColumnName("清洗数量"); bean.setSequence(3); - }else if("装配记录".equals(record)){ + }else if("装配记录".equals(type)){ bean.setColumnName("配包数量"); bean.setSequence(4); - }else if("审核记录".equals(record)){ + }else if("审核记录".equals(type)){ bean.setColumnName("审核数量"); bean.setSequence(5); - }else if("灭菌记录".equals(record)){ + }else if("灭菌记录".equals(type)){ bean.setColumnName("灭菌数量"); bean.setSequence(6); - }else if("发货记录".equals(record)){ + }else if("发货记录".equals(type)){ bean.setColumnName("发货数量"); bean.setSequence(7); - }else if("检查数量".equals(record)){ + }else if("检查数量".equals(type)){ bean.setColumnName("检查数量"); bean.setSequence(8); - }else if("包装数量".equals(record)){ + }else if("包装数量".equals(type)){ bean.setColumnName("包装数量"); bean.setSequence(9); - }else if("核对记录".equals(record)){ + }else if("核对记录".equals(type)){ bean.setColumnName("核对数量"); bean.setSequence(10); } list.add(bean); } - } catch (SQLException e) { + } catch (Exception e) { e.printStackTrace(); }finally { DatabaseUtil.closeResultSetAndStatement(rs1); Index: ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js =================================================================== diff -u -r15784 -r16028 --- ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 15784) +++ ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 16028) @@ -1401,8 +1401,7 @@ haveDeviceInterface = result; }); // 没有接口不需要校验循环次数 - if( haveDeviceInterface ) - { + if(haveDeviceInterface){ WashAndDisinfectRecordTableManager.isRinserCycleCounterExist(id,rinserName,cycleCounter, function(result) { sign = result; @@ -1412,8 +1411,7 @@ showResult("清洗机的循环次数已存在,保存失败!"); return false; } - }else - { + }else{ top.Ext.getCmp('cycleCounter').setValue(0); } }