44 lines
1.5 KiB
Plaintext
Executable File
44 lines
1.5 KiB
Plaintext
Executable File
package com.fp.general.rules.query.code;
|
|
|
|
import com.fp.bpm.query.Query;
|
|
import com.fp.dto.Response;
|
|
import com.fp.dto.query.QueryRequest;
|
|
import com.fp.dto.rules.QueryRule;
|
|
import com.fp.persistence.pgeneral.image.TgeneFilesDetail;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* Clase que se encarga de enviar la fecha de creacion y de vigencia de la firma
|
|
* @author scastillo
|
|
*/
|
|
public class InfoDataFile extends QueryRule {
|
|
|
|
/**
|
|
* Metodo que envia la informacion de fechas del archivo
|
|
* @param pQueryRequest
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
|
|
Response response = pQueryRequest.getResponse();
|
|
Query query = new Query();
|
|
query.process(pQueryRequest);
|
|
List<Map<String, String>> infoImage = new ArrayList<Map<String, String>>();
|
|
List<Object> dataImage = (List<Object>) response.get("TGENEFILESDETAIL");
|
|
for (Object obj : dataImage) {
|
|
TgeneFilesDetail tgeneFilesDetail = (TgeneFilesDetail) obj;
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
map.put("datefrom", tgeneFilesDetail.getDatefrom().toString());
|
|
map.put("dateto", tgeneFilesDetail.getPk().getDateto().toString());
|
|
infoImage.add(map);
|
|
}
|
|
response.remove("TGENEFILESDETAIL");
|
|
response.put("TGENEFILESDETAIL", infoImage);
|
|
return pQueryRequest;
|
|
}
|
|
}
|