dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31645
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16158: local/in Maintenance RBF work in progress
------------------------------------------------------------
revno: 16158
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-07-17 14:15:11 +0100
message:
local/in Maintenance RBF work in progress
modified:
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/ShowUpdateAggregationQueryFormAction.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/SaveDataValueAction.java
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ValidateTariffDataAction.java
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.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/LoadQualityScoreDetailsAction.java
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/getAllLookups.vm
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm
--
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-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java 2014-03-14 11:22:16 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java 2014-07-17 13:15:11 +0000
@@ -55,7 +55,9 @@
{
lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.PBF_AGG_TYPE ) );
- dataElementList = new ArrayList<DataElement>( dataElementService.getAllActiveDataElements() );
+ //dataElementList = new ArrayList<DataElement>( dataElementService.getAllActiveDataElements() );
+ dataElementList = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+
/* Lookup lookup = lookupService.getLookupByName( "IS_PBF_AGGREGATED_DE_ATTRIBUTE_ID" );
Iterator<DataElement> iterator = dataElementList.iterator();
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/ShowUpdateAggregationQueryFormAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/ShowUpdateAggregationQueryFormAction.java 2014-03-14 11:22:16 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/ShowUpdateAggregationQueryFormAction.java 2014-07-17 13:15:11 +0000
@@ -93,7 +93,9 @@
lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.PBF_AGG_TYPE ) );
Collections.sort( lookups, IdentifiableObjectNameComparator.INSTANCE );
- dataElementList = new ArrayList<DataElement>( dataElementService.getAllActiveDataElements() );
+ //dataElementList = new ArrayList<DataElement>( dataElementService.getAllActiveDataElements() );
+ dataElementList = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+
Collections.sort( dataElementList, IdentifiableObjectNameComparator.INSTANCE );
aggregation = aggregationConditionService.getCaseAggregationCondition( id );
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/SaveDataValueAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/SaveDataValueAction.java 2014-01-18 12:25:59 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/SaveDataValueAction.java 2014-07-17 13:15:11 +0000
@@ -201,7 +201,8 @@
dataValue.setCategoryOptionCombo(optionCombo);
dataValue.setValue( value.trim() );
- dataValue.setTimestamp( now );
+ //dataValue.setTimestamp( now );
+ dataValue.setLastUpdated( now );
dataValue.setStoredBy( storedBy );
dataValueService.addDataValue( dataValue );
@@ -212,7 +213,8 @@
if( !(value.trim().equalsIgnoreCase( dataValue.getValue() )) )
{
dataValue.setValue( value.trim() );
- dataValue.setTimestamp( now );
+ //dataValue.setTimestamp( now );
+ dataValue.setLastUpdated( now );
dataValue.setStoredBy( storedBy );
dataValueService.updateDataValue( dataValue );
}
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm 2014-04-11 12:06:13 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm 2014-07-17 13:15:11 +0000
@@ -40,8 +40,8 @@
<col>
<thead>
<tr>
- <th>$i18n.getString( "name" )</th>
- <th>$i18n.getString( "type" )</th>
+ <th>$i18n.getString( "type" )</th>
+ <th>$i18n.getString( "name" )</th>
</tr>
</thead>
<tbody id="list">
@@ -54,8 +54,8 @@
data-can-manage="$security.canManage( $lookup )"
data-can-update="$security.canUpdate( $lookup )"
data-can-delete="$security.canDelete( $lookup )">
- <td>$encoder.htmlEncode( $!lookup.name )</td>
- <td>$encoder.htmlEncode( $!lookup.getDescription() )</td>
+ <td>$encoder.htmlEncode( $!lookup.getType() )</td>
+ <td>$encoder.htmlEncode( $!lookup.name )</td>
</tr>
#end
</tbody>
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ValidateTariffDataAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ValidateTariffDataAction.java 2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/ValidateTariffDataAction.java 2014-07-17 13:15:11 +0000
@@ -178,6 +178,9 @@
TariffDataValue tariffDataValue = tariffDataValueService.getTariffDataValue( organisationUnit, orgUnitGroup, dataElement, dataSet, sDate, eDate );
+
+
+
if ( tariffDataValue == null )
{
String value = tariffDataValueService.getTariffDataValue( orgUnitGroup.getId(), organisationUnit.getId(), dataSet.getId(), dataElement.getId(), startDate );
@@ -201,13 +204,23 @@
return ERROR;
}
}
+
+ if ( tariffDataValue != null && ( pbfType == null || tariffDataValue.getDataSet().getId() != Integer.parseInt( pbfType ) ) )
+ {
+ message = "Data Already Exists, Please Specify Another Date";
+
+ return ERROR;
+ }
+
+
+ /*
else
{
message = "Data Already Exists, Please Specify Another Date";
return ERROR;
}
-
+ */
message = "ok";
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java 2014-06-20 10:21:56 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/LoadDataEntryFormAction.java 2014-07-17 13:15:11 +0000
@@ -19,6 +19,8 @@
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -277,10 +279,30 @@
period = PeriodType.getPeriodFromIsoString( selectedPeriodId );
- dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
-
- Collections.sort( dataElements );
-
+ //dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
+
+ //Collections.sort( dataElements );
+
+
+ List<Section> sectionList = new ArrayList<Section>( dataSet.getSections() );
+ List<DataElement> tempDEList = new ArrayList<DataElement>();
+
+ if( sectionList != null && sectionList.size() > 0 )
+ {
+ Collections.sort(sectionList ,new SectionOrderComparator());
+
+ for ( Section section : sectionList )
+ {
+ tempDEList.addAll( section.getDataElements() );
+ }
+
+ dataElements.addAll( tempDEList );
+ }
+ else
+ {
+ dataElements.addAll( dataSet.getDataElements() );
+ }
+
optionCombos = new ArrayList<DataElementCategoryOptionCombo>();
Map<Integer, Double> tariffDataValueMap = new HashMap<Integer, Double>();
=== 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-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/GetOrganisationUnitForMaxAction.java 2014-07-17 13:15:11 +0000
@@ -16,7 +16,8 @@
import com.opensymphony.xwork2.Action;
-public class GetOrganisationUnitForMaxAction implements Action
+public class GetOrganisationUnitForMaxAction
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
@@ -28,36 +29,36 @@
{
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;
}
-
+
@Autowired
private OrganisationUnitGroupService orgUnitGroupService;
-
+
// -------------------------------------------------------------------------
// Input/output
// -------------------------------------------------------------------------
private String message;
-
+
public String getMessage()
{
return message;
}
-
+
private String orgUnitId;
-
+
public String getOrgUnitId()
{
return orgUnitId;
@@ -69,14 +70,14 @@
}
private String orgUnitGroupId;
-
- public void setOrgUnitGroupId(String orgUnitGroupId)
+
+ public void setOrgUnitGroupId( String orgUnitGroupId )
{
- this.orgUnitGroupId = orgUnitGroupId;
- }
-
- private List<DataSet> dataSets = new ArrayList<DataSet>();
-
+ this.orgUnitGroupId = orgUnitGroupId;
+ }
+
+ private List<DataSet> dataSets = new ArrayList<DataSet>();
+
public List<DataSet> getDataSets()
{
return dataSets;
@@ -86,48 +87,50 @@
// Action implementation
// -------------------------------------------------------------------------
- public String execute() throws Exception
+ public String execute()
+ throws Exception
{
- OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
-
- OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( Integer.parseInt( orgUnitGroupId ) );
-
+ OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
+
+ OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( Integer
+ .parseInt( orgUnitGroupId ) );
+
List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_QUALITY_TYPE ) );
-
+
List<DataSet> pbfDataSets = new ArrayList<DataSet>();
-
- for( Lookup lookup : lookups )
+
+ for ( Lookup lookup : lookups )
{
Integer dataSetId = Integer.parseInt( lookup.getValue() );
-
+
DataSet dataSet = dataSetService.getDataSet( dataSetId );
- if( dataSet != null )
+ if ( dataSet != null )
{
- pbfDataSets.add(dataSet);
-
+ pbfDataSets.add( dataSet );
+
}
}
-
+
dataSets.addAll( orgUnitGroup.getDataSets() );
-
+
System.out.println( "Before : " + dataSets.size() );
-
+
dataSets.retainAll( pbfDataSets );
-
- Collections.sort(dataSets);
-
+
+ Collections.sort( dataSets );
+
System.out.println( "After : " + 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/quality/dataentry/LoadQualityScoreDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java 2014-05-31 13:40:53 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java 2014-07-17 13:15:11 +0000
@@ -17,6 +17,8 @@
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -194,7 +196,9 @@
SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
Period period = PeriodType.getPeriodFromIsoString( selectedPeriodId );
+
Constant tariff_authority = constantService.getConstantByName( TARIFF_SETTING_AUTHORITY );
+
int tariff_setting_authority = 0;
if ( tariff_authority == null )
{
@@ -213,7 +217,7 @@
String orgUnitBranchIds = "-1";
for( OrganisationUnit orgUnit : orgUnitBranch )
{
- orgUnitBranchIds += "," + orgUnit.getId();
+ orgUnitBranchIds += "," + orgUnit.getId();
}
DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dataSetId ) );
@@ -227,7 +231,31 @@
qualityMaxValueMap.putAll( qualityMaxValueService.getQualityMaxValues( orgUnitGroup, orgUnitBranchIds, dataSet, period ) );
}
- List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
+ //List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
+
+ List<DataElement> dataElementList = new ArrayList<DataElement>();
+
+
+ List<Section> sectionList = new ArrayList<Section>( dataSet.getSections() );
+ List<DataElement> tempDEList = new ArrayList<DataElement>();
+
+ if( sectionList != null && sectionList.size() > 0 )
+ {
+ Collections.sort(sectionList ,new SectionOrderComparator());
+
+ for ( Section section : sectionList )
+ {
+ tempDEList.addAll( section.getDataElements() );
+ }
+
+ dataElementList.addAll( tempDEList );
+ }
+ else
+ {
+ dataElementList.addAll( dataSet.getDataElements() );
+ }
+
+
for ( DataElement de : dataElementList )
{
Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
@@ -250,23 +278,35 @@
}
}
- Collections.sort( dataElements );
+ //Collections.sort( dataElements );
List<Lookup> lookups = new ArrayList<Lookup>( lookupService.getAllLookupsByType( Lookup.DS_PAYMENT_TYPE ) );
DataSet paymentDataSet = null;
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[1] ) == Integer.parseInt( dataSetId ) )
{
+ //System.out.println( "Inside if condition ----- " + Integer.parseInt( lookupType[1] ) + " ---- " + Integer.parseInt( dataSetId ) );
paymentDataSet = dataSetService.getDataSet( Integer.parseInt( lookupType[0] ) );
break;
}
}
int flag = 1;
+
+ //System.out.println(" Payment dataSet Name ---" + paymentDataSet.getName() );
+
+ //System.out.println( period.getStartDate() + " -- " + period.getEndDate() );
+
+ //System.out.println(" Payment dataSet Period Type---" + paymentDataSet.getPeriodType() );
+
+
Set<Period> periods = new HashSet<Period>( periodService.getIntersectingPeriodsByPeriodType( paymentDataSet.getPeriodType(), period.getStartDate(), period.getEndDate() ) );
+
for( Period period1 : periods )
{
Double overAllAdjustedAmt = defaultPBFAggregationService.calculateOverallUnadjustedPBFAmount( period1, organisationUnit, paymentDataSet );
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/getAllLookups.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/getAllLookups.vm 2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/getAllLookups.vm 2014-07-17 13:15:11 +0000
@@ -40,8 +40,8 @@
<col>
<thead>
<tr>
- <th>$i18n.getString( "name" )</th>
- <th>$i18n.getString( "type" )</th>
+ <th>$i18n.getString( "type" )</th>
+ <th>$i18n.getString( "name" )</th>
</tr>
</thead>
<tbody id="list">
@@ -54,8 +54,8 @@
data-can-manage="$security.canManage( $lookup )"
data-can-update="$security.canUpdate( $lookup )"
data-can-delete="$security.canDelete( $lookup )">
- <td>$encoder.htmlEncode( $!lookup.name )</td>
- <td>$encoder.htmlEncode( $!lookup.getDescription() )</td>
+ <td>$encoder.htmlEncode( $!lookup.getType() )</td>
+ <td>$encoder.htmlEncode( $!lookup.name )</td>
</tr>
#end
</tbody>
=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm 2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadTariffData.vm 2014-07-17 13:15:11 +0000
@@ -126,7 +126,7 @@
{
var dataValue = {
'orgUnitGroupId' : orgUnitGroupId,
- 'orgUnitUid' : organisationUnitId,
+ 'organisationUnitId' : organisationUnitId,
'dataElementId' : dataElementId,
'dataSetId' : dataSetId,
'startDate' : startDate,
@@ -325,10 +325,10 @@
<td data-sorter="shortDate" data-date-format="yyyymmdd">$simpleDateFormat.format($!tariff.endDate)</td>
##if($updateAuthority == 'Yes')
<td>
- <a href="javascript:deleteTariffDataValue('$tariff.organisationUnit.id','$tariff.orgUnitGroup.id','$tariff.dataElement.id','$tariff.dataSet.id','$tariff.startDate','$tariff.endDate')">
+ <a href="javascript:deleteTariffDataValue('$tariff.organisationUnit.id','$tariff.orgUnitGroup.id','$tariff.dataElement.id','$tariff.dataSet.id','$simpleDateFormat.format($!tariff.startDate)','$simpleDateFormat.format($!tariff.endDate)')">
<img src="images/delete.png" width="17px"/>
</a>
- <a href="javascript:editTariffDataValue('$tariff.organisationUnit.id','$tariff.orgUnitGroup.id','$tariff.dataElement.id','$tariff.dataSet.id','$tariff.startDate','$tariff.endDate','$tariff.value','$!tariff.target','$!tariff.targetPercentage')">
+ <a href="javascript:editTariffDataValue('$tariff.organisationUnit.id','$tariff.orgUnitGroup.id','$tariff.dataElement.id','$tariff.dataSet.id','$simpleDateFormat.format($!tariff.startDate)','$simpleDateFormat.format($!tariff.endDate)','$tariff.value','$!tariff.target','$!tariff.targetPercentage')">
<img src="../images/edit.png" alt="$i18n.getString( 'edit' )" width="17px"/>
</a>
</td>