📄 updateoveroraddagainaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.xfaccp.struts.action.stock;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.xfaccp.base.BaseAction;
import com.xfaccp.form.StockTable;
/**
* MyEclipse Struts
* Creation date: 11-07-2007
*
* XDoclet definition:
* @struts.action scope="request"
*/
public class UpdateOverOrAddagainAction extends BaseAction {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
/*
* 完成所有修改时调用的Method
*/
public ActionForward updateOver(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
HttpSession session=request.getSession();
try
{
//取出当前操作的采购购单实体
StockTable stockTable=(StockTable)session.getAttribute("stock_TBL");
System.out.println("***Test****"+stockTable.getId());
System.out.println("***Test****"+stockTable.getStoreIdea());
//从当前会话中取出是修改的仓管提出的意见或是经理提出的意见
String currentSession=(String)session.getAttribute("currentSession");
if(currentSession.equals("searchStoreIdeas"))
{
//将该采购单的availity属性改为1表明还要经过仓管的审批
stockTable.setAvailability(1);
this.command.update(stockTable);
}
if(currentSession.equals("searchManagerIdeas"))
{
//将该采购单的availity属性改为3表明还要经过仓管的审批
stockTable.setAvailability(3);
this.command.update(stockTable);
}
//清空该表单关联的所有Session中的属性值
if(session.getAttribute("stock_TBL")!=null)
{
session.removeAttribute("stock_TBL");
}
if(session.getAttribute("updateStatus")!=null)
{
session.removeAttribute("updateStatus");
}
if(session.getAttribute("addNewStatus")!=null)
{
session.removeAttribute("addNewStatus");
}
if(session.getAttribute("storeNew_idealist")!=null)
{
session.removeAttribute("storeNew_idealist");
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
return mapping.findForward("viewStoreAllIdeasDO");
}
/*
* 添加新的采购项时调用的Method
*/
public ActionForward addAdviceAgain(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
HttpSession session=request.getSession();
//清空该表单关联的所有Session中的属性值
if(session.getAttribute("updateStatus")!=null)
{
session.removeAttribute("updateStatus");
}
if(session.getAttribute("addNewStatus")!=null)
{
session.removeAttribute("addNewStatus");
}
try
{
//--------------------测试----------------------
//取出当前操作的采购单的实体
StockTable stockTable=(StockTable)session.getAttribute("stock_TBL");
System.out.println("*******"+stockTable.getId());
System.out.println("*******"+stockTable.getStoreIdea());
//-------------------------------------------------
//查找出所有的零件的ID
List list=this.command.findAllList();
System.out.println("******"+list.size()+"种零件!");
request.setAttribute("accessory_List",list);
}
catch(Exception ex)
{
ex.printStackTrace();
}
return mapping.findForward("addAdviceAgain");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -