|
|
|
|
@ -23,10 +23,12 @@ import com.evolute.utils.sql.Insert;
|
|
|
|
|
import com.evolute.utils.sql.Select;
|
|
|
|
|
import com.evolute.utils.sql.Select2;
|
|
|
|
|
import com.evolute.utils.sql.Update;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Locale;
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
import siprp.medicina.MedicinaConstants;
|
|
|
|
|
import siprp.medicina.processo.data.TrabalhadoresConsultasData;
|
|
|
|
|
@ -40,6 +42,8 @@ import siprp.medicina.processo.data.TrabalhadoresProcessoData;
|
|
|
|
|
public class ProcessoDataProvider
|
|
|
|
|
implements MedicinaConstants, ProcessoConstants
|
|
|
|
|
{
|
|
|
|
|
private static final DateFormat D_F = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
|
|
|
|
|
|
|
|
|
|
public static final HashMap<String,String> ESTADO_PROCESSO_BY_CODE =
|
|
|
|
|
new HashMap<String,String>();
|
|
|
|
|
|
|
|
|
|
@ -253,6 +257,45 @@ public class ProcessoDataProvider
|
|
|
|
|
EXECUTER.executeQuery( insert );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IDObject[] getEmailConsultaData( Integer consultaDataID )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select =
|
|
|
|
|
new Select2( new String[]{ "trabalhadores_consultas_datas_emails" },
|
|
|
|
|
new Integer[]{},
|
|
|
|
|
new Expression[]{},
|
|
|
|
|
new String[]{ "id", "data", "subject" },
|
|
|
|
|
new Field( "trabalhadores_consultas_datas_id" ).isEqual( consultaDataID ),
|
|
|
|
|
new String[]{ "data DESC" },
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null );
|
|
|
|
|
Virtual2DArray array = EXECUTER.executeQuery( select );
|
|
|
|
|
IDObject mails[] = new IDObject[ array.columnLength() ];
|
|
|
|
|
for( int n = 0; n < mails.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Date data = ( Date ) array.get( n, 1 );
|
|
|
|
|
String desc = D_F.format( data ) + " : " + array.get( n, 2 );
|
|
|
|
|
mails[ n ] = new MappableObject( ( Integer ) array.get( n, 0 ), desc );
|
|
|
|
|
}
|
|
|
|
|
return mails;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void saveEmailConsultaData( Integer consultaDataID, String destination,
|
|
|
|
|
String subject, String body )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Insert insert =
|
|
|
|
|
new Insert( "trabalhadores_consultas_datas_emails",
|
|
|
|
|
new Assignment[]{
|
|
|
|
|
new Assignment( "destination", destination ),
|
|
|
|
|
new Assignment( "subject", subject ),
|
|
|
|
|
new Assignment( "body", body ),
|
|
|
|
|
new Assignment( "data", new Date() ),
|
|
|
|
|
new Assignment( "trabalhadores_consultas_datas_id", consultaDataID ) } );
|
|
|
|
|
EXECUTER.executeQuery( insert );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer getLastConsultaDataIDForConsulta( Integer consultaID )
|
|
|
|
|
throws Exception
|
|
|
|
|
|