/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.yuntong.action.ajaxaction;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.yuntong.business.vo.G_TruckInfoAndStyleVO;
import com.yuntong.business.vo.Y_AreaInfoVO;
import com.yuntong.service.G_ITruckInfoService;


/** 
 * MyEclipse Struts
 * Creation date: 04-09-2007
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 */
public class G_TruckParticularInfoAction extends Action {
	private G_ITruckInfoService truckInfoService;
	/*
	 * Generated Methods
	 */

	/** 
	 * 根据车牌得到车的型号等
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * @throws IOException 
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws IOException {
		response.setContentType("text/xml; charset=UTF-8");
		PrintWriter out = response.getWriter();
		String str=request.getParameter("truckNum");
		String truckNum=new String(str.getBytes("ISO-8859-1"),"UTF-8");
		G_TruckInfoAndStyleVO vo=truckInfoService.getTruckParticularInfo(truckNum);
		out.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
		out.print("<info>");
			out.print("<truckNum value='"+vo.getTruckNum()+"'>");
			out.print(vo.getTruckNum());
			out.print("</truckNum>");
			
			out.print("<truckPhoto value='"+vo.getTruckPhoto()+"'>");
			out.print(vo.getTruckPhoto());
			out.print("</truckPhoto>");
			
			out.print("<truckStyleName value='"+vo.getTruckStyleName()+"'>");
			out.print(vo.getTruckStyleName());
			out.print("</truckStyleName>");
			
			out.print("<truckStyleTonnage value='"+vo.getTruckStyleTonnage()+"'>");
			out.print(vo.getTruckStyleTonnage());
			out.print("</truckStyleTonnage>");
			
			out.print("<truckStyleCubage value='"+vo.getTruckStyleCubage()+"'>");
			out.print(vo.getTruckStyleCubage());
			out.print("</truckStyleCubage>");
		out.print("</info>");
		return null;
	}

	public G_ITruckInfoService getTruckInfoService() {
		return truckInfoService;
	}

	public void setTruckInfoService(G_ITruckInfoService truckInfoService) {
		this.truckInfoService = truckInfoService;
	}
}