package com.zking.purchase.action;
import java.sql.Date;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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 org.apache.struts.actions.DispatchAction;
import com.zking.purchase.bean.GoodsBean;
import com.zking.purchase.bean.OrderBean;
import com.zking.purchase.bean.StoreRoomBean;
import com.zking.purchase.bean.SupplierBean;
import com.zking.purchase.formbean.OrderForm;
import com.zking.purchase.service.BuyerServices;
import com.zking.util.PageBean;
import com.zking.Login.bean.UserBean;
public class OrderAction extends DispatchAction {
/**
* 查询跳转到新增入库单页面上所需要的数据,再转发到新增入库单据页面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward addOrder(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
BuyerServices bs = new BuyerServices();
Map<String,Object> map = null;
// 对数据进行处理
map = bs.getNewPageElement(0);
List<StoreRoomBean> stores = (ArrayList<StoreRoomBean>)map.get("stores");//所有仓库
List<SupplierBean> supps = (ArrayList<SupplierBean>)map.get("supps");//所有供应商
List<GoodsBean> goods =(ArrayList<GoodsBean>)map.get("goods");//所有仓库List中第一个元素对应的所有商品
request.setAttribute("stores", stores);
request.setAttribute("supps", supps);
request.setAttribute("goods", goods);
bs.conn.close();
//request.setAttribute(name, o)
// 转发请求
return mapping.findForward("addorder");
}
/**
* 查询跳转到新增退货单据页面上所需要的数据,再转发到新增退货单据页面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward addOrdeReturn(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
BuyerServices bs = new BuyerServices();
Map<String,Object> map = null;
// 对数据进行处理
map = bs.getNewPageElement(0);
List<StoreRoomBean> stores = (ArrayList<StoreRoomBean>)map.get("stores");//所有仓库
List<SupplierBean> supps = (ArrayList<SupplierBean>)map.get("supps");//所有供应商
List<GoodsBean> goods =(ArrayList<GoodsBean>)map.get("goods");//所有仓库List中第一个元素对应的所有商品
request.setAttribute("stores", stores);
request.setAttribute("supps", supps);
request.setAttribute("goods", goods);
bs.conn.close();
// 转发请求
return mapping.findForward("addordereturn");
}
/**
* 从库存盘点部分针对某一种商品进行采购,查询跳转到新增入库单页面上所需要的数据,再转发到新增入库单据页面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward addOrder_Goods(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
BuyerServices bs = new BuyerServices();
Map<String,Object> map = null;
// 接收数据
String goodid = request.getParameter("gid");
int gid = 0;
if(goodid!=null&&goodid.length()>0){
gid=Integer.parseInt(goodid);
}
// 对数据进行处理
map = bs.getNewPageElement(gid);
List<StoreRoomBean> stores = (ArrayList<StoreRoomBean>)map.get("stores");//所有仓库
List<SupplierBean> supps = (ArrayList<SupplierBean>)map.get("supps");//所有供应商
List<GoodsBean> goods =(ArrayList<GoodsBean>)map.get("goods");//所有仓库List中第一个元素对应的所有商品
GoodsBean addedgood = (GoodsBean)map.get("addedgood");
StoreRoomBean select_store = (StoreRoomBean) map.get("select_store");
request.setAttribute("stores", stores);
request.setAttribute("supps", supps);
request.setAttribute("goods", goods);
request.setAttribute("addedgood", addedgood);
request.setAttribute("select_store", select_store);
bs.conn.close();
// 转发请求
return mapping.findForward("addorder");
}
/**
* 修改入库单的请求,将要修改的入库单的详细信息储存在request中,转发到编辑入库单的页面
*
*
* @param mapping
* @param form
* ActionForm,转换为OrderForm
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward editOrder(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map<String,Object> map = null;
BuyerServices bs = new BuyerServices();
// 接收数据
OrderForm of = (OrderForm) form;
int oid = of.getOid();
OrderBean order = bs.getOrderDetail(oid);
// 对数据进行处理
request.setAttribute("order", order);
map = bs.getNewPageElement(0);
List<StoreRoomBean> stores = (ArrayList<StoreRoomBean>)map.get("stores");//所有仓库
List<SupplierBean> supps = (ArrayList<SupplierBean>)map.get("supps");//所有供应商
List<GoodsBean> goods =(ArrayList<GoodsBean>)map.get("goods");//所有仓库List中第一个元素对应的所有商品
request.setAttribute("stores", stores);
request.setAttribute("supps", supps);
request.setAttribute("goods", goods);
bs.conn.close();
// 转发请求
return mapping.findForward("editorder");
}
/**
* 修改退货单的请求,将要修改的退货单的详细信息储存在request中,转发到编辑退货单的页面
*
* @param mapping
* @param form
* ActionForm,转换为OrderForm
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward editOrdeReturn(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map<String,Object> map = null;
BuyerServices bs = new BuyerServices();
// 接收数据
OrderForm of = (OrderForm) form;
int oid = of.getOid();
OrderBean order = bs.getOrderDetail(oid);
// 对数据进行处理
request.setAttribute("order", order);
map = bs.getNewPageElement(0);
List<StoreRoomBean> stores = (ArrayList<StoreRoomBean>)map.get("stores");//所有仓库
List<SupplierBean> supps = (ArrayList<SupplierBean>)map.get("supps");//所有供应商
List<GoodsBean> goods =(ArrayList<GoodsBean>)map.get("goods");//所有仓库List中第一个元素对应的所有商品
request.setAttribute("stores", stores);
request.setAttribute("supps", supps);
request.setAttribute("goods", goods);
bs.conn.close();
// 转发请求
return mapping.findForward("editordereturn");
}
/**
* 增加入库单的方法,返回值是一个ActionForward
*
* @param mapping
* @param form
* ActionForm,转换为OrderForm
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward addOrderSave(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
OrderForm oform = (OrderForm) form;
OrderBean order = new OrderBean(); // 表示订单的JavaBean
BuyerServices bs = new BuyerServices();
ActionForward af = new ActionForward();// 转发
Map<String, Object> resultmap = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<String, Object>();
List<OrderBean> orders = new ArrayList<OrderBean>();
HttpSession session = request.getSession();
UserBean user= (UserBean) session.getAttribute("user");//当前登录采购员的信息在session中。
if(user==null)
{
return mapping.findForward("timeout");//登陆超时,session已经失效。
}
// 接收数据
order.setBuyer(user.getSname()); // 单据的经手人
order.setOidenty(oform.getOidenty()); // 单据的编号
order.setGid(oform.getGid()); // 商品的主键,在新增时为空,不填。商品下
没有合适的资源?快使用搜索试试~ 我知道了~
进销存管理系统源代码
共1003个文件
gif:162个
repository:105个
entries:105个
1星 需积分: 9 15 下载量 39 浏览量
2011-03-16
22:38:33
上传
评论
收藏 3.05MB RAR 举报
温馨提示
J2EE开发的进销存管理系统,只含源代码,struts1+jsp+Ajax+javaWeb
资源推荐
资源详情
资源评论
收起资源包目录
进销存管理系统源代码 (1003个子文件)
.#updateOrder_sell.html.1.1 13KB
.#updateOrder_return.html.1.1 12KB
.#newOrder.html.1.1 8KB
.#newOrder_return.html.1.1 8KB
.#ReportFormDAO.java.1.4 5KB
.#ReportFormDAO.java.1.4 5KB
ckdb.html.bak 7KB
inquire1.html.bak 6KB
inquire.html.bak 4KB
check.html.bak 3KB
demo.css.bak 3KB
move.html.bak 3KB
check1.html.bak 2KB
find.bmp 822B
find.bmp 822B
add.bmp 654B
add.bmp 654B
SellerDAO1.class 20KB
OrderAction.class 18KB
DBServe.class 16KB
ClientDao.class 14KB
SellerService1.class 13KB
SellerAction.class 13KB
ClientAction.class 13KB
storeManagerDAO.class 9KB
GoodsDao.class 8KB
BuyerServices.class 8KB
EmpDao.class 8KB
SystemDao.class 7KB
EmpAction.class 7KB
SystemAction1.class 7KB
StoreroomAction.class 7KB
StoreroomDao.class 7KB
GoodsAction.class 6KB
SellerOrderBean.class 6KB
storeManagerSearchAction.class 6KB
ClientService.class 6KB
ClientFormBean.class 6KB
SellBean.class 5KB
OrderForm.class 5KB
UserDAO.class 5KB
sellAjax.class 5KB
BBSDao.class 5KB
BuyAjaxServlet.class 4KB
SystemService.class 4KB
ReportFormDAO.class 4KB
ReportFormBean.class 4KB
GoodsService.class 4KB
OrderBean.class 4KB
LoginAction.class 4KB
loginDao.class 4KB
StoreroomService.class 4KB
BBSAction.class 4KB
ReportFormsAction.class 4KB
storeManagerSearchForm.class 4KB
EmpFormBean.class 4KB
registerForm.class 3KB
LinkerFormBean.class 3KB
UserBean.class 3KB
checkStoreSeavlet.class 3KB
UserBean.class 3KB
storeManagerVO.class 3KB
EmpInfo.class 3KB
EmpService.class 3KB
moveStoreServlet.class 3KB
BBSService.class 3KB
ReportFormAction.class 3KB
storeManagerService.class 3KB
Supplier.class 3KB
ClientInfo.class 3KB
GoodsInfo.class 3KB
GoodsBean.class 3KB
GoodsForm.class 3KB
SellerAjax.class 2KB
StoreroomFormBean.class 2KB
LoginService.class 2KB
ReportFormServices.class 2KB
SetCharacterEncodingFilter.class 2KB
SearchClientForm.class 2KB
SearchEmpForm.class 2KB
LinkerS.class 2KB
LinkerC.class 2KB
SearchOrderBean.class 2KB
PageBean.class 2KB
BBSBean.class 2KB
OrderDetailBean.class 2KB
StoreroomInfo.class 2KB
AddForm.class 1KB
PageBean.class 1KB
DBUtil.class 1KB
GoodsInfoForm.class 1KB
SearchSRForm.class 1KB
SupplierBean.class 1KB
SearchForm.class 1KB
StoreRoomBean.class 1000B
StoreType.class 964B
SearchGoodsForm.class 787B
BaseForm.class 503B
BuyerExceptionHandler.class 469B
SellerServiceException.class 404B
共 1003 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
- 宏观与微观2012-04-06没有数据库啊!而且页面很幼稚
pxede1
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功