平面設(shè)計接單一個月多少錢寧波網(wǎng)站推廣網(wǎng)站優(yōu)化
項目描述
臨近學(xué)期結(jié)束,還是畢業(yè)設(shè)計,你還在做java程序網(wǎng)絡(luò)編程,期末作業(yè),老師的作業(yè)要求覺得大了嗎?不知道畢業(yè)設(shè)計該怎么辦?網(wǎng)頁功能的數(shù)量是否太多?沒有合適的類型或系統(tǒng)?等等。這里根據(jù)疫情當(dāng)下,你想解決的問題,今天給大家介紹一篇基于JavaWeb的網(wǎng)上銷售系統(tǒng)設(shè)計與實(shí)現(xiàn)。
功能需求
本網(wǎng)上銷售系統(tǒng)通過分析和確定系統(tǒng)的角色和功能劃分,按照業(yè)務(wù)合理區(qū)分為不同的菜單功能模塊。從用戶角度出發(fā),對每個功能的需求實(shí)現(xiàn)點(diǎn)進(jìn)行人性化詳細(xì)的構(gòu)思。對每個功能的細(xì)節(jié)點(diǎn)進(jìn)行分析設(shè)計整合完成整個網(wǎng)上銷售系統(tǒng)的設(shè)計。這兩類的主要功能如下:
(1)前端網(wǎng)頁:
1、網(wǎng)站首頁
2、用戶登錄注冊
3、全部商品
4、新聞公告
5、咨詢客服
6、詳情下單
7、個人中心
(2)后臺管理
1、后臺主頁
2、購物車管理
3、訂單信息管理
4、留言管理
5、個人中心
6、商品信息管理
7、管理員登錄
部分效果圖
部分代碼
/*** 前臺、后臺、登錄。* 和修改密碼項*/
public class LoginCtrl extends HttpServlet {// 構(gòu)造函數(shù)public LoginCtrl() {super();}// 析構(gòu)函數(shù)public void destroy() {super.destroy(); // Just puts "destroy" string in log// Put your code here}// get 訪問得時候運(yùn)行這個方法public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// 將get 方法得內(nèi)容運(yùn)行到Post 方法中this.doPost(request, response);}// 輸出彈出框、并跳轉(zhuǎn)到指定頁面public void go(String url, HttpServletRequest request, HttpServletResponse response) {try {// 獲取輸出流PrintWriter out = response.getWriter();// 輸出到控制臺System.out.println(request.getAttribute("error"));// 判斷有沒有錯誤、有得話就輸出彈出框if (request.getAttribute("error") != null) {out.println("<script>alert('" + request.getAttribute("error") + "');location.href='" + url + "'</script>");out.close();return;}// 加載指定jsp 頁面、request.getRequestDispatcher(url).forward(request, response);} catch (ServletException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}}// 跳轉(zhuǎn)到某個頁面public void gor(String url, HttpServletRequest request, HttpServletResponse response) {try {// 執(zhí)行頁面跳轉(zhuǎn)response.sendRedirect(url);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}// 執(zhí)行post 方法public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// 設(shè)定編碼為 utf-8response.setContentType("text/html;charset=utf-8");// 獲取輸出流PrintWriter out = response.getWriter();// 判斷執(zhí)行那個 if 判斷內(nèi)容String ac = request.getParameter("ac");if (ac == null) ac = "";// 生成數(shù)據(jù)庫查詢對象CommDAO dao = new CommDAO();// 獲取當(dāng)前時間String date = Info.getDateStr();// 獲取當(dāng)前日期String today = date.substring(0, 10);// 獲取當(dāng)前年月String tomonth = date.substring(0, 7);// 前臺登錄代碼if (ac.equals("login")) {// 獲取前臺填寫得賬號String username = request.getParameter("username");// 獲取前臺填寫得密碼String password = request.getParameter("pwd");// 判斷頁面上選擇的權(quán)限String utype = request.getParameter("cx");// 獲取填寫得驗證碼String pagerandom = request.getParameter("pagerandom") == null ? "" : request.getParameter("pagerandom");// 獲取生成驗證碼時保存在session 中得驗證碼String random = (String) request.getSession().getAttribute("random");// 對比驗證碼是否正確、不正確則輸出驗證碼錯誤if (!pagerandom.equals(random) && request.getParameter("a") != null) {request.setAttribute("error", "驗證碼錯誤");go("index.jsp", request, response);} else {String sql1 = "";if (utype.equals("用戶")) {sql1 = "select * from yonghu where yonghuming='" + username + "' and mima='" + password + "' ";}// 查詢數(shù)據(jù)庫中得信息判斷賬號密碼得正確性Map map = dao.find(sql1);// map 不為空則是登錄成功if (!map.isEmpty()) {// 獲取數(shù)據(jù)循環(huán)Iterator iter = map.keySet().iterator();// 設(shè)置sessionrequest.getSession().setAttribute("username", username);request.getSession().setAttribute("login", utype);request.getSession().setAttribute("cx", utype);while (iter.hasNext()) {// 這個循環(huán)設(shè)置用戶得信息進(jìn)session 中String key = (String) iter.next();String val = (String) map.get(key);request.getSession().setAttribute(key, val);}// 跳轉(zhuǎn)到index.jspgor("index.jsp", request, response);} else {// 否則提示賬號或密碼錯誤request.setAttribute("error", "賬號或密碼錯誤");go("index.jsp", request, response);}}}// 后臺登錄if (ac.equals("adminlogin")) {// 后臺管理員登錄// 獲取前臺填寫得賬號String username = request.getParameter("username");// 獲取前臺填寫得密碼String password = request.getParameter("pwd");// 判斷頁面上選擇的權(quán)限String utype = request.getParameter("cx");// 獲取填寫得驗證碼String pagerandom = request.getParameter("pagerandom") == null ? "" : request.getParameter("pagerandom");// 獲取生成驗證碼時保存在session 中得驗證碼String random = (String) request.getSession().getAttribute("random");// 對比驗證碼是否正確、不正確則輸出驗證碼錯誤if (!pagerandom.equals(random) && request.getParameter("a") != null) {request.setAttribute("error", "驗證碼錯誤");go("login.jsp", request, response);} else {String sql1 = "";if (utype.equals("管理員")) {sql1 = "select * from admins where username='" + username + "' and pwd='" + password + "' ";}// 查詢數(shù)據(jù)庫中得信息判斷賬號密碼得正確性Map map = dao.find(sql1);// map 不為空則是登錄成功if (!map.isEmpty()) {// 獲取數(shù)據(jù)循環(huán)Iterator iter = map.keySet().iterator();// 設(shè)置sessionrequest.getSession().setAttribute("username", username);request.getSession().setAttribute("cx", utype);request.getSession().setAttribute("login", utype);while (iter.hasNext()) {// 這個循環(huán)設(shè)置用戶得信息進(jìn)session 中String key = (String) iter.next();String val = (String) map.get(key);request.getSession().setAttribute(key, val);}// 跳轉(zhuǎn)到main.jspgor("main.jsp", request, response);} else {// 否則提示賬號或密碼錯誤request.setAttribute("error", "賬號或密碼錯誤");go("login.jsp", request, response);}}}//修改密碼if (ac.equals("adminuppass")) {// 獲取前臺填寫得原密碼String olduserpass = request.getParameter("ymm");// 獲取前臺填寫得新密碼String userpass = request.getParameter("xmm1");// 獲取前臺填寫得確認(rèn)密碼String copyuserpass = request.getParameter("xmm2");// println(Info.getUser(request).get("id").toString());// 判斷當(dāng)前權(quán)限pString cx = (String) request.getSession().getAttribute("login");//String oldPassword = "";// 獲取當(dāng)前登錄用戶的賬號String username = request.getSession().getAttribute("username").toString();Map m = null;String biao = "";if (cx.equals("管理員")) {biao = "admins";m = Query.make(biao).where("username", username).where("pwd", olduserpass).find();// dao.getmaps("username", (String) request.getSession().getAttribute("username"), "admins");}if (cx.equals("用戶")) {biao = "yonghu";m = Query.make(biao).where("yonghuming", username).where("mima", olduserpass).find();// dao.getmaps("yonghuming", (String) request.getSession().getAttribute("username"), "yonghu");}// 嘗試登錄一下原密碼、如果為null 或 空map則提示原密碼錯誤if (m == null || m.isEmpty()) {// 提示原密碼錯誤request.setAttribute("error", "原密碼錯誤");go("mod.jsp", request, response);} else {//String id = (String)user.get("id");// 否則更新成新密碼String sql = "";if (cx.equals("管理員")) {sql = "UPDATE admins SET pwd='" + userpass + "' WHERE username='" + username + "'";}if (cx.equals("用戶")) {sql = "UPDATE yonghu SET mima='" + userpass + "' WHERE yonghuming='" + username + "'";}//執(zhí)行更新密碼dao.commOper(sql);// 提示密碼修改成功request.setAttribute("error", "密碼修改成功");go("mod.jsp", request, response);}}dao.close();out.flush();out.close();}public void init() throws ServletException {// Put your code here}
}
安裝部署需求
eclipse運(yùn)行啟動
系統(tǒng)部署
系統(tǒng)開發(fā)后,在生產(chǎn)環(huán)境配置項目運(yùn)行環(huán)境,具體步驟如下:
安裝linux或者windows10操作系統(tǒng);
安裝JDK1.8并配置環(huán)境變量;
安裝MySQL5.7版本以上版本數(shù)據(jù)庫,創(chuàng)建數(shù)據(jù)庫并執(zhí)行腳本創(chuàng)建表;
在eclipse中運(yùn)行打包;
本項目用到的技術(shù)和框架
1.開發(fā)語言:Java
2.開發(fā)模式:B/S
3.數(shù)據(jù)庫:MySQL5.7
4.框架:Servlet+JSP
本項目中的關(guān)鍵點(diǎn)
此系統(tǒng)的開發(fā)采用java語言開發(fā),基于B/S結(jié)構(gòu),這些開發(fā)環(huán)境使系統(tǒng)更加完善。使用到的工具和技術(shù)都是開源免費(fèi)的。
環(huán)境工具
開發(fā)工具 Eclipse
語言 JDK1.8 、Servlet+JDBC+JSP
硬件:筆記本電腦;
軟件:Tomcat8.0 Web服務(wù)器、Navicat數(shù)據(jù)庫客戶端、MySQL;
操作系統(tǒng):Windows 10;
其它軟件:截圖工具、常用瀏覽器;
以上是本系統(tǒng)的部分功能展示,如果你的選題正好相符,那么可以做畢業(yè)設(shè)計或課程設(shè)計使用。