【正文】
系統(tǒng)界面與功能實(shí)現(xiàn) 51 入庫模塊 的實(shí)現(xiàn) 當(dāng)某種已有物品進(jìn)貨后就需要在此輸入庫存記錄信息并同時(shí)輸入相應(yīng)貨物入庫信息并加入到庫存中為以后進(jìn)行入庫貨物的查詢和出庫操作產(chǎn)生操作數(shù)據(jù)供管理人員掌握倉庫內(nèi)存儲的貨物情況界面如圖 5- 1 所示 圖 51 入庫模塊 主要代碼 public void doPost HttpServletRequest request HttpServletResponse response throws ServletException IOException responsesetContentType texthtmlcharset gb2312 requestsetCharacterEncoding gb2312 String mark requestgetParameter mark String id requestgetParameter id String name requestgetParameter name String str String sql InsertUpdateDelBean ib new InsertUpdateDelBean 入庫 if mark null markequals add str adminentrytype_listjsp sql insert into entrytype name values name int flag ibinsertANDupdateANDdel sql if flag 1 str adminentrytypejsp requestsetAttribute message 入庫類型名稱重復(fù) else requestsetAttribute message 操作成功 if mark null markequals update str adminentrytypejspmark markid id sql update entrytype set name name where id id int flag ibinsertANDupdateANDdel sql if flag 1 requestsetAttribute message 入庫類型名稱重復(fù) else requestsetAttribute message 操作成功 RequestDispatcher rd requestgetRequestDispatcher str rdforward requestresponse 圖 52 產(chǎn)品出庫 主要 代碼 public class GetouttypeServlet extends HttpServlet public GetouttypeServlet super public void destroy superdestroy Just puts destroy string in log Put your code here Public void doGet HttpServletRequest request HttpServletResponse response throws ServletException IOException doPost request response Public void doPost HttpServletRequest request HttpServletResponse response 從數(shù)據(jù)庫獲取數(shù)據(jù) throws ServletException IOException responsesetContentType texthtmlcharset gb2312 requestsetCharacterEncoding gb2312 String mark requestgetParameter mark String id requestgetParameter id String name requestgetParameter name String str String sql 出庫并且更新數(shù)據(jù)庫 InsertUpdateDelBean ib new InsertUpdateDelBean if mark null markequals add str admingetouttype_listjsp sql insert into getouttype name values name int flag ibinsertANDupdateANDdel sql if flag 1 str admingetouttypejsp requestsetAttribute message 出庫類型名稱重復(fù) else requestsetAttribute message 操作成功 if mark null markequals update str admingetouttypejspmark markid id sql update getouttype set name name where id id int flag ibinsertANDupdateANDdel sql if flag 1 requestsetAttribute message 出庫類型名稱重復(fù) else requestsetAttribute message 操作成功 RequestDispatcher rd requestgetRequestDispatcher str rdforward requestresponse 53 盤點(diǎn)模塊的實(shí)現(xiàn) 當(dāng)每個(gè)月的盤點(diǎn)時(shí)間到后需要對數(shù)據(jù)庫中的貨物數(shù)量跟實(shí)際的相比對如果數(shù)量不對就要查清原因并進(jìn)行相應(yīng)處理以使貨物信息明了此模塊通過定期對倉庫信息做清點(diǎn)有效的了解了貨物的流通情況和倉庫貨物的損耗情況方便對貨物信息的管理界面如圖 5- 3 所示 圖 53 盤點(diǎn)圖 主要代碼 public class PandianServlet extends HttpServlet public PandianServlet super public void destroy superdestroy Just puts destroy string in log Put your code here public void doGet HttpServletRequest request HttpServletResponse response throws ServletException IOException doPost request response public void doPost HttpServletRequest request HttpServletResponse response throws ServletException IOException responsesetContentType texthtmlcharset gb2312 requestsetCharacterEncoding gb2312 String mark requestgetParameter mark String id requestgetParameter id String name requestgetParameter name String str adminstockjsp String sql rtUpdateDelBean ib new r