dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19249
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8313: Error in auto-send sms messages.
------------------------------------------------------------
revno: 8313
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-10-01 11:52:51 +0700
message:
Error in auto-send sms messages.
modified:
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/HibernateOutboundSmsStore.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ExecuteSendMessageAction.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 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/HibernateOutboundSmsStore.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/HibernateOutboundSmsStore.java 2012-10-01 04:09:27 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/HibernateOutboundSmsStore.java 2012-10-01 04:52:51 +0000
@@ -104,10 +104,9 @@
realStatus = OutboundSmsStatus.ERROR.ordinal();
}
- String sql = "select osm.id as outboundsmsid, message, ore.elt as phonenumber "
+ String sql = "select osm.id as outboundsmsid, message, ore.elt as phonenumber, date "
+ "from outbound_sms osm inner join outbound_sms_recipients ore "
+ "on osm.id=ore.outbound_sms_id where status = " + realStatus ;
-
try
{
List<OutboundSms> OutboundSmsList = jdbcTemplate.query( sql, new RowMapper<OutboundSms>()
@@ -117,9 +116,10 @@
{
OutboundSms outboundSms = new OutboundSms( rs.getString( 2 ), rs.getString( 3 ) );
outboundSms.setId( rs.getInt( 1 ) );
+ outboundSms.setDate( rs.getDate( 4 ) );
return outboundSms;
}
- } );
+ });
return OutboundSmsList;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ExecuteSendMessageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ExecuteSendMessageAction.java 2012-10-01 04:09:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ExecuteSendMessageAction.java 2012-10-01 04:52:51 +0000
@@ -80,15 +80,15 @@
@Override
public String execute()
{
-
Collection<SchedulingProgramObject> schedulingProgramObjects = programStageInstanceService
.getSendMesssageEvents();
for ( SchedulingProgramObject schedulingProgramObject : schedulingProgramObjects )
{
String message = schedulingProgramObject.getMessage();
+
String phoneNumber = schedulingProgramObject.getPhoneNumber();
-
+
try
{
OutboundSms outboundSms = new OutboundSms( message, phoneNumber );