dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13257
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4199: local vn - Fixed bug show data entry status.
------------------------------------------------------------
revno: 4199
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-07-22 16:27:59 +0700
message:
local vn - Fixed bug show data entry status.
modified:
local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java
local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java'
--- local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java 2011-07-20 07:16:20 +0000
+++ local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateExportReportStore.java 2011-07-22 09:27:59 +0000
@@ -55,6 +55,8 @@
* @author Tran Thanh Tri
* @version $Id$
*/
+
+@Transactional
public class HibernateExportReportStore
implements ExportReportStore
{
@@ -186,7 +188,7 @@
return sessionFactory.getCurrentSession().createCriteria( clazz ).list();
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public Collection<ReportExcel> getExportReportsByReportType( String reportType )
{
Class<?> clazz = null;
@@ -203,7 +205,7 @@
{
clazz = ReportExcelOganiztionGroupListing.class;
}
-
+
return getExportReportsByClazz( clazz );
}
@@ -280,7 +282,6 @@
return sqlQuery.list();
}
- @Override
public void deleteMultiExportItem( Collection<Integer> ids )
{
String sql = "delete ReportExcelItem d where d.id in (:ids)";
@@ -321,29 +322,23 @@
{
Session session = sessionFactory.getCurrentSession();
- String sql = "select count(*) from datavalue where sourceid=" + organisationUnit.getId()
- + " and dataelementid in (";
-
- int i = 0;
+ Collection<Integer> deIds = new HashSet<Integer>();
for ( DataElement element : dataSet.getDataElements() )
{
- sql += element.getId();
-
- if ( i++ < dataSet.getDataElements().size() - 1 )
- {
- sql += ",";
- }
+ deIds.add( element.getId() );
}
- sql += ") and periodid=" + period.getId();
+ String sql = "select count(*) from DataValue where sourceid=" + organisationUnit.getId();
+ sql += " and periodid=" + period.getId();
+ sql += " and dataelementid in (:deIds)";
Query query = session.createQuery( sql );
+ query.setParameterList( "deIds", deIds );
Number nr = (Number) query.uniqueResult();
return nr == null ? 0 : nr.intValue();
-
}
public void deleteDataEntryStatus( int id )
@@ -409,21 +404,18 @@
session.update( arg0 );
}
- @Override
public PeriodColumn getPeriodColumn( Integer id )
{
Session session = sessionFactory.getCurrentSession();
return (PeriodColumn) session.get( PeriodColumn.class, id );
}
- @Override
public void updatePeriodColumn( PeriodColumn periodColumn )
{
Session session = sessionFactory.getCurrentSession();
session.update( periodColumn );
}
- @Transactional
public void updateReportWithExcelTemplate( String curTemplateName, String newTemplateName )
{
Session session = sessionFactory.getCurrentSession();
@@ -435,7 +427,5 @@
query.setString( "newName", newTemplateName ).setString( "curName", curTemplateName );
query.executeUpdate();
-
}
-
}
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java 2011-04-04 04:54:43 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/dataentrystatus/action/GetDataSetAction.java 2011-07-22 09:27:59 +0000
@@ -1,7 +1,7 @@
package org.hisp.dhis.reportexcel.dataentrystatus.action;
/*
- * Copyright (c) 2004-2010, University of Oslo
+ * Copyright (c) 2004-2011, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,35 +54,20 @@
// -------------------------------------------------------------------------
private CurrentUserService currentUserService;
-
- private OrganisationUnitSelectionManager selectionManager;
+
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
private UserService userService;
- // -------------------------------------------------------------------------
- // Ouput
- // -------------------------------------------------------------------------
-
- private List<DataSet> dataSets;
-
- // -------------------------------------------------------------------------
- // Getter & Setter
- // -------------------------------------------------------------------------
-
- public List<DataSet> getDataSets()
- {
- return dataSets;
- }
-
public void setUserService( UserService userService )
{
this.userService = userService;
}
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
+ private OrganisationUnitSelectionManager selectionManager;
public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
{
@@ -90,9 +75,20 @@
}
// -------------------------------------------------------------------------
+ // Getter & Setter
+ // -------------------------------------------------------------------------
+
+ private List<DataSet> dataSets;
+
+ public List<DataSet> getDataSets()
+ {
+ return dataSets;
+ }
+
+ // -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
-
+
public String execute()
throws Exception
{