← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17546: local/in Bug fixing in Maintenance RBF

 

------------------------------------------------------------
revno: 17546
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-11-20 07:51:59 +0000
message:
  local/in Bug fixing in Maintenance RBF
modified:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/GetOrganisationUnitAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetOrganisationUnitForPaymentAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/LoadPaymentAdjustmentAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForScoreAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.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/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java	2014-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/LoadTariffDetailsAction.java	2014-11-20 07:51:59 +0000
@@ -184,7 +184,8 @@
         */
         
         List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
-
+        
+        dataSets = new ArrayList<DataSet>();
         for ( Lookup lookup : lookups )
         {
             Integer dataSetId = Integer.parseInt( lookup.getValue() );

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/GetOrganisationUnitAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/GetOrganisationUnitAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/GetOrganisationUnitAction.java	2014-11-20 07:51:59 +0000
@@ -79,6 +79,7 @@
         OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
         //organisationUnit.get
         
+        dataSets = new ArrayList<DataSet>();
         dataSets = new ArrayList<DataSet>( organisationUnit.getDataSets() );
         
         List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetOrganisationUnitForPaymentAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetOrganisationUnitForPaymentAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetOrganisationUnitForPaymentAction.java	2014-11-20 07:51:59 +0000
@@ -21,9 +21,10 @@
 
 import com.opensymphony.xwork2.Action;
 
-public class GetOrganisationUnitForPaymentAction implements Action
+public class GetOrganisationUnitForPaymentAction
+    implements Action
 {
-	
+
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -34,39 +35,40 @@
     {
         this.organisationUnitService = organisationUnitService;
     }
-    
+
     private LookupService lookupService;
-    
+
     public void setLookupService( LookupService lookupService )
     {
         this.lookupService = lookupService;
     }
 
     private DataSetService dataSetService;
-    
+
     public void setDataSetService( DataSetService dataSetService )
     {
         this.dataSetService = dataSetService;
     }
+
     private I18nFormat format;
 
     public void setFormat( I18nFormat format )
     {
         this.format = format;
     }
-    
+
     // -------------------------------------------------------------------------
     // Input/output
     // -------------------------------------------------------------------------
     private String message;
-    
+
     public String getMessage()
     {
         return message;
     }
-    
+
     private String orgUnitId;
-    
+
     public String getOrgUnitId()
     {
         return orgUnitId;
@@ -78,77 +80,81 @@
     }
 
     private List<DataSet> dataSets = new ArrayList<DataSet>();
-    
+
     public List<DataSet> getDataSets()
     {
         return dataSets;
     }
+
     private List<Period> periods = new ArrayList<Period>();
 
     public Collection<Period> getPeriods()
     {
         return periods;
     }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
-    public String execute() throws Exception
+    public String execute()
+        throws Exception
     {
         OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
+
+        /*
+         * List<OrganisationUnit> organisationUnitList = new
+         * ArrayList<OrganisationUnit>(
+         * organisationUnitService.getOrganisationUnitWithChildren
+         * (organisationUnit.getId()) ) ; for (OrganisationUnit org :
+         * organisationUnitList) { if(!dataSets.containsAll(org.getDataSets()))
+         * { dataSets.addAll(org.getDataSets()); } }
+         */
+        List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
         
-        /* List<OrganisationUnit> organisationUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren(organisationUnit.getId()) ) ;
-        for (OrganisationUnit org : organisationUnitList) 
+        dataSets = new ArrayList<DataSet>();
+        for ( Lookup lookup : lookups )
         {
-        	if(!dataSets.containsAll(org.getDataSets()))
-        	{
-        		dataSets.addAll(org.getDataSets());
-        	}
-		}
-        */
-        List<Lookup> lookups = new ArrayList<Lookup>(lookupService
-				.getAllLookupsByType(Lookup.DS_PBF_TYPE));
-
-		for (Lookup lookup : lookups) 
-		{
-			Integer dataSetId = Integer.parseInt(lookup.getValue());
-
-			DataSet dataSet = dataSetService.getDataSet(dataSetId);
-
-			dataSets.add(dataSet);
-		}
-        Collections.sort(dataSets); 
-        String periodType = "Quarterly" ;
+            Integer dataSetId = Integer.parseInt( lookup.getValue() );
+
+            DataSet dataSet = dataSetService.getDataSet( dataSetId );
+
+            dataSets.add( dataSet );
+        }
         
+        Collections.sort( dataSets );
+        String periodType = "Quarterly";
+
         CalendarPeriodType _periodType = (CalendarPeriodType) CalendarPeriodType.getPeriodTypeByName( periodType );
-        
+
         Calendar cal = PeriodType.createCalendarInstance();
-        
+
         periods = _periodType.generatePeriods( cal.getTime() );
-        //periods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( periodType ) );
-        
+        // periods = new ArrayList<Period>(
+        // periodService.getPeriodsByPeriodType( periodType ) );
+
         FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
 
         Collections.reverse( periods );
-        //Collections.sort( periods );
+        // Collections.sort( periods );
         for ( Period period : periods )
         {
-            //System.out.println("ISO Date : " + period.getIsoDate() );
-            
+            // System.out.println("ISO Date : " + period.getIsoDate() );
+
             period.setName( format.formatPeriod( period ) );
         }
-       
+
         System.out.println( dataSets.size() );
         if ( dataSets.size() > 0 )
         {
             message = organisationUnit.getName();
             return SUCCESS;
-            
+
         }
         else
         {
             message = organisationUnit.getName();
-            
+
             return INPUT;
         }
 

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/GetPaymentAdjustmentDetailsAction.java	2014-11-20 07:51:59 +0000
@@ -131,7 +131,8 @@
         }
 
         List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) );
-
+        
+        dataSets = new ArrayList<DataSet>();
         for ( Lookup lookup : lookups )
         {
             Integer dataSetId = Integer.parseInt( lookup.getValue() );

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/LoadPaymentAdjustmentAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/LoadPaymentAdjustmentAction.java	2014-07-23 11:47:17 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/payment/action/LoadPaymentAdjustmentAction.java	2014-11-20 07:51:59 +0000
@@ -84,20 +84,20 @@
     // Input / Output
     // -------------------------------------------------------------------------
     private MathTool mathTool = new MathTool();
-    
-    public MathTool getMathTool() 
+
+    public MathTool getMathTool()
     {
-		return mathTool;
-	}
+        return mathTool;
+    }
 
     private String availableAmount = "";
 
-    public String getAvailableAmount() 
+    public String getAvailableAmount()
     {
-		return availableAmount;
-	}
+        return availableAmount;
+    }
 
-	private Map<Integer, Double> pbfQtyMap = new HashMap<Integer, Double>();
+    private Map<Integer, Double> pbfQtyMap = new HashMap<Integer, Double>();
 
     public Map<Integer, Double> getPbfQtyMap()
     {
@@ -146,13 +146,11 @@
         this.periodIso = periodIso;
     }
 
-    
-    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
-	public String execute()
+    public String execute()
         throws Exception
     {
         System.out.println( "Inside Adjustment screen" );
@@ -170,7 +168,8 @@
 
         period = periodService.reloadPeriod( period );
 
-        Set<Period> periods = new HashSet<Period>( periodService.getIntersectingPeriods( period.getStartDate(), period.getEndDate() ) );
+        Set<Period> periods = new HashSet<Period>( periodService.getIntersectingPeriods( period.getStartDate(),
+            period.getEndDate() ) );
         Collection<Integer> periodIds = new ArrayList<Integer>( getIdentifiers( Period.class, periods ) );
         String periodIdsByComma = getCommaDelimitedString( periodIds );
 
@@ -179,7 +178,8 @@
         Set<OrganisationUnit> pbfQtyOrgUnits = new HashSet<OrganisationUnit>();
         pbfQtyOrgUnits.addAll( organisationUnitService.getOrganisationUnitWithChildren( selOrgUnit.getId() ) );
         pbfQtyOrgUnits.retainAll( selDataSet.getSources() );
-        Collection<Integer> orgUnitIds = new ArrayList<Integer>( getIdentifiers( OrganisationUnit.class, pbfQtyOrgUnits ) );
+        Collection<Integer> orgUnitIds = new ArrayList<Integer>(
+            getIdentifiers( OrganisationUnit.class, pbfQtyOrgUnits ) );
         String orgUnitIdsByComma = getCommaDelimitedString( orgUnitIds );
 
         // --------------------------------------------------------
@@ -214,29 +214,31 @@
         for ( Lookup lookup : lookups )
         {
             String[] lookupType = lookup.getValue().split( ":" );
-            System.out.println( lookup.getValue() +"  " + Integer.parseInt( lookupType[0] ) + "  " + Integer.parseInt( dataSetId ) );
+            System.out.println( lookup.getValue() + "  " + Integer.parseInt( lookupType[0] ) + "  "
+                + Integer.parseInt( dataSetId ) );
             if ( Integer.parseInt( lookupType[0] ) == Integer.parseInt( dataSetId ) )
             {
-                qualityScoreDataSet = dataSetService.getDataSet( Integer.parseInt(  lookupType[1] ) );
+                qualityScoreDataSet = dataSetService.getDataSet( Integer.parseInt( lookupType[1] ) );
                 break;
             }
         }
 
         if ( qualityScoreDataSet != null )
         {
-            overAllQualityScore = defaultPBFAggregationService.calculateOverallQualityScore( period, qualityScoreDataSet.getSources(), qualityScoreDataSet.getId(), tariffOrgUnit.getId() );
+            overAllQualityScore = defaultPBFAggregationService.calculateOverallQualityScore( period,
+                qualityScoreDataSet.getSources(), qualityScoreDataSet.getId(), tariffOrgUnit.getId() );
         }
 
-        //-------------------------------------------------------------
+        // -------------------------------------------------------------
         // Availbale Amount
-        //-------------------------------------------------------------
+        // -------------------------------------------------------------
         Constant paymentAmount = constantService.getConstantByName( Lookup.PAYMENT_ADJUSTMENT_AMOUNT_DE );
         DataElement dataElement = dataElementService.getDataElement( (int) paymentAmount.getValue() );
         DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
         DataValue dataValue = dataValueService.getDataValue( dataElement, period, selOrgUnit, optionCombo );
         if ( dataValue != null )
         {
-        	availableAmount = dataValue.getValue();
+            availableAmount = dataValue.getValue();
         }
 
         return SUCCESS;
@@ -245,7 +247,7 @@
     public OrganisationUnit findParentOrgunitforTariff( OrganisationUnit organisationUnit, Integer tariffOULevel )
     {
         Integer ouLevel = organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() );
-        
+
         if ( tariffOULevel == ouLevel )
         {
             return organisationUnit;

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java	2014-10-24 11:05:35 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java	2014-11-20 07:51:59 +0000
@@ -123,7 +123,9 @@
         dataSets.addAll( tempDataSets );
         */
         
-        dataSets.retainAll( dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) );
+        dataSets = new ArrayList<DataSet>();
+        
+        dataSets.addAll( dataSetService.getDataSetsBySources( orgUnitGroup.getMembers() ) );
         
         //dataSets.addAll( orgUnitGroup.getDataSets() );
 

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForScoreAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForScoreAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForScoreAction.java	2014-11-20 07:51:59 +0000
@@ -105,8 +105,8 @@
         }
         
         dataSets.retainAll( pbfDataSets );
+        
         Collections.sort(dataSets);
-        
        
         System.out.println( dataSets.size() );
         if ( dataSets.size() > 0 )

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java	2014-09-04 10:07:26 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java	2014-11-20 07:51:59 +0000
@@ -166,6 +166,8 @@
         
         List<DataSet> pbfDataSets = new ArrayList<DataSet>();
         
+        dataSets = new ArrayList<DataSet>();
+        
         for( Lookup lookup : lookups )
         {
             Integer dataSetId = Integer.parseInt( lookup.getValue() );
@@ -179,6 +181,7 @@
         }
         
         dataSets.addAll( pbfDataSets );
+        
         Collections.sort(dataSets);
         return SUCCESS;
     }

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java	2014-07-23 11:47:17 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java	2014-11-20 07:51:59 +0000
@@ -106,6 +106,7 @@
     	 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
         
+        dataSets = new ArrayList<DataSet>();
         if( organisationUnit == null )
         {
             System.out.println("Organisationunit is null");
@@ -143,6 +144,7 @@
         }
         
         dataSets.retainAll( pbfDataSets );
+        
         Collections.sort(dataSets);
         return SUCCESS;
     }