📄 merchantstorageinfoqueryaction.java
字号:
/*
* 作者:刘云云
* 时间:2007年12月19日
* 功能:库存销售管理->入库历史查询
*/
package com.mole.struts.action;
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.mole.struts.bean.MerchantGoodsStorageBean;
import com.mole.struts.bean.MerchantGoodsTypeBean;
import com.mole.struts.bean.MerchantStorageInfoBean;
import com.mole.struts.dao.MerchantGoodsStorageDAO;
import com.mole.struts.dao.MerchantStorageInfoDAO;
import com.mole.struts.form.MerchantStorageInfoQueryForm;
/**
* MyEclipse Struts Creation date: 12-19-2007
*
* XDoclet definition:
*
* @struts.action validate="true"
* @struts.action-forward name="goMerchantStorageInfoQuery"
* path="/merchantStorageInfoQuery.jsp"
*/
public class MerchantStorageInfoQueryAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String storeId = (String) request.getSession().getAttribute("store");
if (storeId == null)
return null;
MerchantStorageInfoBean[] records = null;
MerchantStorageInfoQueryForm mgsrForm = (MerchantStorageInfoQueryForm) form;
MerchantStorageInfoDAO dao = null;
Object daoObj = request.getSession().getAttribute("pageDataRecord");
if (daoObj != null && daoObj instanceof MerchantStorageInfoDAO) {
dao = (MerchantStorageInfoDAO) daoObj;
} else {
String column = " goodsNumber,name,typeName,amount,price,stockDate,merchantName ";
dao = new MerchantStorageInfoDAO(column, null, " ID ", null,
" ID ", 10);
dao.setWhere(" v_StorageInfo ", storeId, mgsrForm.getTypeId(),
mgsrForm.getGoodsName(), null, null);
request.getSession().setAttribute("pageDataRecord", dao);
}
String pageIndex = mgsrForm.getPageIndex();
if (pageIndex != null && !pageIndex.equals("")) {
dao.setCurrentPage(Integer.parseInt(pageIndex));
dao.setPageSize(Integer.parseInt(mgsrForm.getPageSizeSelect()));
dao.setWhere(" v_StorageInfo ", storeId, mgsrForm.getTypeId(),
mgsrForm.getGoodsName(), null, null);
}
MerchantGoodsStorageDAO mbrd = new MerchantGoodsStorageDAO();
String sql = "SELECT Name,GoodsType,GoodsNumber FROM Goods WHERE StoreID="
+ storeId;
MerchantGoodsStorageBean[] arrayList = mbrd.getGoodsStorageName(sql);
request.setAttribute("names", arrayList);
sql = "SELECT ID,Name FROM GoodsType WHERE StoreID=" + storeId;
MerchantGoodsTypeBean[] types = mbrd.getGoodsType(sql);
request.setAttribute("types", types);
records = dao.getStorageInfoPage();
request.setAttribute("result", records);
return mapping.findForward("goMerchantStorageInfoQuery");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -