maia/.svn/pristine/02/020e7560b5e5c2b827ec34e7aca...

56 lines
1.9 KiB
Plaintext
Executable File

package com.fp.frontend.webservices.impl;
import java.util.Date;
import javax.jws.WebService;
import com.fp.common.logger.APPLogger;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.frontend.helper.CallerHelper;
import com.fp.frontend.webservices.InventarioService;
@WebService(endpointInterface="com.fp.frontend.webservices.InventarioService")
public class InventarioServiceImpl implements InventarioService {
@Override
public String guardaDatosLectura(String tagslectura, Date fechalectura, String locacionlectura, String idportal, String tipooperacion) {
String respuesta = "0";
try {
System.out.println("INGRESO PORTAL ........");
CallerHelper callerHelper = new CallerHelper();
Request request = callerHelper.getRequest();
request.setCompany(1);
request.setTransactionModule("30");
request.setTransactionCode(9996);
request.setTransactionVersion(1);
request.put("TAGSLECTURA", tagslectura);
if(tipooperacion.equals("HHD")){
request.put("FECHALECTURA", new Date());
}else{
request.put("FECHALECTURA", fechalectura);
}
request.put("LOCACIONLECTURA", locacionlectura);
request.put("IDPORTAL", idportal);
request.put("TIPOOPERACION", tipooperacion);
Response response = callerHelper.executeSave(request);
if(response.getResponseCode().compareTo(Response.RESPONSE_OK) == 0){
respuesta = (String) response.get("RESPONSESTATUS");
} else{
respuesta = "2";
}
} catch (Throwable e) {
System.out.println("error:.........."+e);
respuesta = "1";
APPLogger.getLogger().error(e.getMessage(), e);
}
return respuesta;
}
public static void main(String[] args) {
InventarioServiceImpl guarda= new InventarioServiceImpl();
System.out.println(guarda.guardaDatosLectura("E2003098851500251190A810", new Date(), "GUAYAS", "0001", "PTL"));
}
}