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

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

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_RegisterAndGoodsInfoVO;
import com.yuntong.business.vo.Y_AreaInfoVO;
import com.yuntong.business.vo.Y_RegisterInfoVO;
import com.yuntong.service.G_IRegisterInfoService;
import com.yuntong.service.Y_IRegisterManagerService;
import com.yuntong.service.impl.G_RegisterInfoService;

/** 
 * MyEclipse Struts
 * Creation date: 04-09-2007
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 */
public class G_FindRegisterInfoAction extends Action {
	private G_IRegisterInfoService registerInfoService;
	
	/*
	 * Generated Methods
	 */
	public G_IRegisterInfoService getRegisterInfoService() {
		return registerInfoService;
	}

	public void setRegisterInfoService(G_IRegisterInfoService registerInfoService) {
		this.registerInfoService = registerInfoService;
	}
	/** 
	 * 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 registerId=request.getParameter("registerGlideID");
		long registerGlideId=Long.parseLong(registerId.trim());
		G_RegisterAndGoodsInfoVO vo=registerInfoService.findRegisterInfoByRegisterGlideID(registerGlideId);
		out.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
		out.print("<info>");
		//货票编号
		out.print("<registerGlideID value='"+vo.getRegisterGlideID()+"'>");
		out.print(vo.getRegisterGlideID());
		out.print("</registerGlideID>");
		//货物名称
		out.print("<goodsName value='"+vo.getGoodsName()+"'>");
		out.print(vo.getGoodsName());
		out.print("</goodsName>");
		//数量单位
		out.print("<goodsNumberUnit value='"+vo.getGoodsNumberUnit()+"'>");
		out.print(vo.getGoodsNumberUnit());
		out.print("</goodsNumberUnit>");
		//货物数量
		out.print("<goodsNumber value='"+vo.getGoodsNumber()+"'>");
		out.print(vo.getGoodsNumber());
		out.print("</goodsNumber>");
		//重量
		out.print("<goodsHeft value='"+vo.getGoodsHeft()+"'>");
		out.print(vo.getGoodsHeft());
		out.print("</goodsHeft>");
		//放量
		out.print("<goodsBulk value='"+vo.getGoodsBulk()+"'>");
		out.print(vo.getGoodsBulk());
		out.print("</goodsBulk>");
		//货票状态(省际运输(1)或者时常配送(2))
		out.print("<registerState value='"+vo.getRegisterState()+"'>");
		out.print(vo.getRegisterState());
		out.print("</registerState>");
		out.print("</info>");
		out.close();
		return null;
	}
}