6077b2d2b815001d1425beaaf88110b5

来自「实训时做的物流系统」· 代码 · 共 68 行

TXT
68
字号
/*******************************************************************************
 * Copyright (c) 2005 Eteration A.S. and others. All rights reserved. This
 * program and the accompanying materials are made available under the terms of
 * the Eclipse Public License v1.0 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: Eteration A.S. - initial API and implementation
 ******************************************************************************/
package com.cost.web.struts.action.bsm;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;

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.cost.biz.bsm.FeeOperate;
import com.cost.persistence.hibernate.pojo.Charge;
import com.cost.persistence.hibernate.pojo.Invoice;
import com.cost.persistence.hibernate.pojo.Order;
import com.cost.web.struts.form.bsm.FeeForm;

public class FeeCancleSearchAction extends Action {

	public ActionForward execute(ActionMapping mapping,
									ActionForm form, 
									HttpServletRequest request, 
									HttpServletResponse response)
									throws IOException, ServletException {
		
        FeeForm ff = (FeeForm)form;
        String invoiceNum = ff.getInvoiceNum();
        String orderNo = ff.getOrder().getOrderNo();
        if(invoiceNum==null)
        {
           try {
			Order order = FeeOperate.FeeView(orderNo);
			Charge charge = FeeOperate.FindCharge(order.getOrderid());
			request.setAttribute("order", order);
			request.setAttribute("charge", charge);
	        return mapping.findForward("success");
		} catch (Exception e) {
			String target = "errorsO";
			request.setAttribute("sign", "be");
	        return mapping.findForward(target);   
 		}
           }else{
        	  try {
				Invoice invoice = FeeOperate.InvoiceFindByNum(invoiceNum);
				String orderNo2 = invoice.getOrder().getOrderNo();
				Order order = FeeOperate.FeeView(orderNo2);
				Charge charge = FeeOperate.FindCharge(order.getOrderid());
				request.setAttribute("order", order);
				request.setAttribute("charge", charge);
				return mapping.findForward("success");
			} catch (Exception e) {
				String target = "errorsI";
				request.setAttribute("sign", "be");
		        return mapping.findForward(target);			}
           }
    }
}
	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?