Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)之線上水果超市商城的實(shí)現(xiàn)
主要技術(shù)實(shí)現(xiàn):spring、 springmvc、 redis、 springboot、??mybatis 、session、?jquery 、 md5 、bootstarp.js??tomcat、、攔截器等。
主要功能實(shí)現(xiàn): 前端:登錄、注冊(cè)、商品分類查看、瀏覽水果商品、訂單管理、發(fā)表評(píng)論、收藏商品、購(gòu)物車管理、個(gè)人訂單管理查看、個(gè)人信息查看修改、地址管理等
后臺(tái)管理員:后臺(tái)登錄、數(shù)據(jù)統(tǒng)計(jì)、系統(tǒng)版本信息等、管理員管理、角色管理、訂單管理、通知公告管理、商品種類、和商品詳情管理
主要功能截圖如下:

用戶填寫(xiě)相關(guān)信息進(jìn)行注冊(cè):

水果商品數(shù)據(jù)列表查看:也可以根據(jù)關(guān)鍵字搜索水果商品信息

水果商品詳情管理:點(diǎn)擊可以查看水果商品購(gòu)買詳情數(shù)據(jù)、可以進(jìn)行數(shù)量操作、加入訂單和購(gòu)物車以及收藏商品和查看排行等功能

我的購(gòu)物車詳情:可以結(jié)算以及繼續(xù)購(gòu)物和刪除購(gòu)物車信息等操作

訂單詳情管理:

我的個(gè)人信息管理:可以進(jìn)行密碼修改、訂單查看管理、收藏查看管理、收獲地址管理

我的評(píng)論查看:

我的收藏;可以移除收藏

后臺(tái)管理員端主要實(shí)現(xiàn): 超級(jí)管理員admin登錄

系統(tǒng)首頁(yè):主要功能用戶、角色、通知公告信息、商品種類以及商品詳情管理和用戶管理以及訂單信息管理等數(shù)據(jù)操作。

后臺(tái)菜單管理:


用戶管理:

通知公告列表展示以及內(nèi)容添加:

后臺(tái)管理員對(duì)水果商品的管理:

上傳商品詳情信息:

商品評(píng)論數(shù)據(jù)維護(hù):

訂單管理和維護(hù):

項(xiàng)目使用eclipse和idea運(yùn)行、推薦idea、源碼架構(gòu):

數(shù)據(jù)庫(kù)設(shè)計(jì)ER圖:

訂單信息控制層:
@Controller
@RequestMapping("/orderInfo")
public class OrderInfoController {
@Autowired
private IOrderInfoBiz orderInfoBiz;
@RequestMapping("/addOrderInfo")
@ResponseBody
public Integer addOrderInfo(String ono, String odate, String ano, String price) {
Integer in = 0;
try {
in = orderInfoBiz.addOrderInfo(ono, odate,ano,price);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return in;
}
@RequestMapping("/getOrder")
@ResponseBody
public List<OrderInfo> getOrder(String mno) {
return orderInfoBiz.getOrder(mno);
}
@RequestMapping("/getallOrder")
@ResponseBody
public List<OrderInfo> getallOrder(String mno) {
return orderInfoBiz.getallOrder(mno);
}
@RequestMapping("/setStatus")
@ResponseBody
public Integer setStatus(String ono) {
System.out.println("修改1");
return orderInfoBiz.setStatus(ono);
}
@RequestMapping("/getOrderByPage")
@ResponseBody
public List<OrderInfo> getOrderByPage(String mno, Integer page) {
return orderInfoBiz.getOrderByPage(mno,page);
}
@RequestMapping("/getPage")
@ResponseBody
public Integer getPage(String mno) {
int total=orderInfoBiz.getTotal(mno);
int page=total%2==0?total/2:total/2+1;
return page;
}
}
商品管理控制層:
@Controller
@RequestMapping("/goodsInfo")
public class GoodsInfoController {
@Autowired
private IGoodsInfoBiz goodsInfoBiz;
@RequestMapping("/findAll")
@ResponseBody
public List<GoodsInfo> findAll() {
return goodsInfoBiz.findAll();
}
@RequestMapping("/find")
@ResponseBody
public GoodsInfo find(String str) {
System.out.println(goodsInfoBiz.find(str));
return goodsInfoBiz.find(str);
}
@RequestMapping("/findByTno")
@ResponseBody
public List<GoodsInfo> findByTno(String tno,String start) {
return goodsInfoBiz.findByTno(tno,start);
}
@RequestMapping("/updateBal")
@ResponseBody
public Integer updateBal(String[] gnos,String[] nums) {
return goodsInfoBiz.updateBal(gnos,nums);
}
@RequestMapping("/finds")
@ResponseBody
public List<GoodsInfo> finds() {
return goodsInfoBiz.finds();
}
@RequestMapping("/upload")
@ResponseBody
public Map<String, Object> add(@RequestParam("upload")MultipartFile pic,HttpServletRequest request) {
Map<String, Object> map = new HashMap<String, Object>();
if(pic.isEmpty()){
return map;
}
try{
String savePath = "images/goods";
String path = request.getServletContext().getRealPath("");
String temp = request.getServletContext().getInitParameter("uploadPath");
if(temp != null){
savePath = temp;
}
//在用戶上傳的文件名的前面加上時(shí)間戳
savePath += "/" + new Date().getTime() + "_" +pic.getOriginalFilename();
File dest = new File(new File(path).getParentFile(),savePath);
//將本地圖片保存到服務(wù)器
pic.transferTo(dest);
map.put("fileName", pic.getOriginalFilename());
map.put("uploaded", 1);
map.put("url","../../../"+savePath);
}catch(IllegalStateException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
return map;
}
//管理員端的商品信息
@RequestMapping("/addGood")
@ResponseBody
public int addGood(@RequestParam Map<String,Object> map,@RequestParam MultipartFile pic, HttpServletRequest request){
int result =-1;
if(pic.isEmpty()){
result=-2;//說(shuō)明沒(méi)有圖片需要上傳
}
String savePath="";
try {
String path= request.getServletContext().getRealPath("");
String temp = request.getServletContext().getInitParameter("uploadpath");
if(!StringUtil.checkNull(temp)){
savePath = temp;
}
savePath="images/goods/"+pic.getOriginalFilename();
File dest = new File(path, savePath);
//將圖片存到服務(wù)器的指定文件夾
pic.transferTo(dest);
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
map.put("pics", savePath);
result=goodsInfoBiz.addGood(map);
return result;
}
@RequestMapping("/findgoods")
@ResponseBody
public List<GoodsInfo> findgoods() {
return goodsInfoBiz.findgoods();
}
@RequestMapping("/del")
@ResponseBody
public int del(String gno) {
return goodsInfoBiz.del(gno);
}
@RequestMapping("/getPage")
@ResponseBody
public Integer getPage(String tno) {
int total=goodsInfoBiz.getTotal(tno);
int page=total%10==0?total/10:total/10+1;
return page;
}
}
購(gòu)物車信息控制層:
@Controller
@RequestMapping("/cartInfo")
public class CartInfoController {
@Autowired
private ICartInfoBiz cartInfoBiz;
@RequestMapping("/finds")
@ResponseBody
public List<GoodsInfo> finds(String mno) {
return cartInfoBiz.finds(mno);
}
@RequestMapping("/update")
@ResponseBody
public Integer update(String cno, Integer num) {
return cartInfoBiz.update(cno, num);
}
@RequestMapping("/del")
@ResponseBody
public Integer del(String cno) {
return cartInfoBiz.del(cno);
}
@RequestMapping("/add")
@ResponseBody
public Integer add(String mno, String gno, Integer num) {
return cartInfoBiz.add(mno,gno,num);
}
@RequestMapping("/checkCar")
@ResponseBody
public Integer checkCar(String mno, String gno) {
return cartInfoBiz.checkCar(mno,gno);
}
@RequestMapping("/dels")
@ResponseBody
public Integer dels(String[] gnos)throws IOException {
return cartInfoBiz.dels(gnos);
}
}
管理信息控制層:
@Controller
@RequestMapping("/admin")
public class AdminInfoController {
@Autowired
private IAdminInfoBiz adminInfoBiz;
@RequestMapping("/checkLogin")
@ResponseBody
public Object checkLogin(HttpSession session) {
Object obj = session.getAttribute("currentLoginUser");
if(obj == null){
return "{\"code\":\"101\"}";
} else {
return obj;
}
}
@RequestMapping("/login")
@ResponseBody
public int login(String aname, String pwd, HttpSession session) {
AdminInfo af = adminInfoBiz.login(aname, pwd);
int result = 0;
if(af != null){
session.setAttribute("currentLoginUser", af);
result = 1;
}
return result;
}
@RequestMapping("/success")
public String loginSuccess(HttpSession session) {
if(session.getAttribute("currentLoginUser") != null){
return "/WEB-INF/back/page/index.html";
} else {
return "/bk/index.html";//以/開(kāi)頭從項(xiàng)目目錄開(kāi)始算
}
}
@RequestMapping("/findAll")
@ResponseBody
public List<AdminInfo> findAll() {
return adminInfoBiz.findAll();
}
@RequestMapping("/add")
@ResponseBody
public int add(String aname, String pwd, String tel) {
return adminInfoBiz.add(aname,pwd,tel);
}
@RequestMapping("/update")
@ResponseBody
public int update(String aid,String tel) {
return adminInfoBiz.update(aid,tel);
}
@RequestMapping("/del")
@ResponseBody
public int del(String aid) {
return adminInfoBiz.del(aid);
}
/*@RequestMapping("/upload")
@ResponseBody
public Map<String, String> upload(MultipartFile pics, HttpServletRequest request, @RequestParam Map<String, Object> params) {
if (pics.isEmpty()){
return Collections.emptyMap();
}
String savePath = "../pics";
try{
String path = request.getServletContext().getRealPath("");
String temp = request.getServletContext().getInitParameter("uploadpath");
if(!StringUtil.checkNull(temp)){
savePath = temp;
}
savePath += "/" + new Date().getTime() + "_" + new Random().nextInt(10000) + "-" + pics.getOriginalFilename();
File dest = new File(path, savePath);
//將圖片存到服務(wù)器的指定文件
pics.transferTo(dest);
} catch (IllegalStateException e){
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
params.put("photo", savePath);
if(adminInfoBiz.updatephoto(params) > 0){
Map<String, String> map = new HashMap<String, String>();
map.put("savepath", savePath);
return map;
} else {
return Collections.emptyMap();
}
}*/
}
菜單信息控制層:?
@Controller
@RequestMapping("/menberInfo")
public class MenberInfoController {
@Autowired
private IMenberInfoBiz menberInfoBiz;
@RequestMapping("/logout")
private Object logout(HttpSession session) {
session.removeAttribute("LoginUser");
return "logoutsuccess";
}
@RequestMapping("/checkLogin")
@ResponseBody
public Object checkLogin(HttpSession session) {
Object obj = session.getAttribute("LoginUser");
if(obj == null){
return "{\"code\":\"101\"}";
} else {
return obj;
}
}
@RequestMapping("/login")
@ResponseBody
public Integer login(String nickname, String pwd, HttpSession session) {
MenberInfo mf = menberInfoBiz.login(nickname, pwd);
int result = 0;
if(mf != null){
session.setAttribute("LoginUser", mf);
result = 1;
}
return result;
}
@RequestMapping("/getTotal")
public Integer getTotal(String no) {
return menberInfoBiz.getTotal(no);
}
@RequestMapping("/reg")
@ResponseBody
public int reg(@RequestParam Map<String, Object> map) {
return menberInfoBiz.reg(map);
}
@RequestMapping("/checkName")
@ResponseBody
public int checkName(String nickname) {
return menberInfoBiz.checkName(nickname);
}
@RequestMapping("/checkTel")
@ResponseBody
public int checkTel(String tel) {
return menberInfoBiz.checkTel(tel);
}
@RequestMapping("/checkEmail")
@ResponseBody
public int checkEmail(String email) {
return menberInfoBiz.checkEmail(email);
}
@RequestMapping("/findAll")
@ResponseBody
public List<MenberInfo> findAll() {
return menberInfoBiz.findAll();
}
@RequestMapping("/del")
@ResponseBody
public int del(String mno) {
return menberInfoBiz.del(mno);
}
/*@RequestMapping("/upload")
@ResponseBody
public Map<String, String> upload(MultipartFile pics, HttpServletRequest request, @RequestParam Map<String, Object> params) {
if (pics.isEmpty()){
return Collections.emptyMap();
}
String savePath = "../pics";
try{
String path = request.getServletContext().getRealPath("");
String temp = request.getServletContext().getInitParameter("uploadpath");
if(!StringUtil.checkNull(temp)){
savePath = temp;
}
savePath += "/" + new Date().getTime() + "_" + new Random().nextInt(10000) + "-" + pics.getOriginalFilename();
File dest = new File(path, savePath);
//將圖片存到服務(wù)器的指定文件
pics.transferTo(dest);
} catch (IllegalStateException e){
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
params.put("photo", savePath);
if(adminInfoBiz.updatephoto(params) > 0){
Map<String, String> map = new HashMap<String, String>();
map.put("savepath", savePath);
return map;
} else {
return Collections.emptyMap();
}
}*/
}
到此這篇關(guān)于Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)之線上水果超市商城的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)Java 線上水果超市商城內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Lombok的詳細(xì)使用及優(yōu)缺點(diǎn)總結(jié)
最近在學(xué)Mybatis,接觸到了Lombok的使用,所以寫(xiě)一篇文章記錄一下,包括lombok的安裝及使用優(yōu)缺點(diǎn),感興趣的朋友跟隨小編一起看看吧2021-07-07
SpringBoot Controller接收參數(shù)的幾種常用方式
這篇文章主要介紹了SpringBoot Controller接收參數(shù)的幾種常用方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-07-07
Java使用wait/notify實(shí)現(xiàn)線程間通信上篇
wait()和notify()是直接隸屬于Object類,也就是說(shuō)所有對(duì)象都擁有這一對(duì)方法,下面這篇文章主要給大家介紹了關(guān)于使用wait/notify實(shí)現(xiàn)線程間通信的相關(guān)資料,需要的朋友可以參考下2022-12-12
Mybatis輸入輸出映射及動(dòng)態(tài)SQL Review
這篇文章主要介紹了Mybatis輸入輸出映射及動(dòng)態(tài)SQL Review,需要的朋友可以參考下2017-02-02
Java實(shí)現(xiàn)AES加密和解密方式完整示例
這篇文章主要給大家介紹了關(guān)于Java實(shí)現(xiàn)AES加密和解密方式的相關(guān)資料,AES加密為最常見(jiàn)的對(duì)稱加密算法,是一種區(qū)塊加密標(biāo)準(zhǔn),這個(gè)標(biāo)準(zhǔn)用來(lái)替代原先的DES,已經(jīng)被多方分析且廣為全世界所使用,需要的朋友可以參考下2023-10-10
SpringCloud?Nacos服務(wù)分級(jí)存儲(chǔ)模型詳解
Nacos服務(wù)分級(jí)存儲(chǔ)模型是Nacos存儲(chǔ)服務(wù)注冊(cè)信息和配置信息的核心模型之一,本文將對(duì)?Nacos?服務(wù)分級(jí)存儲(chǔ)模型進(jìn)行深入解析,感興趣的朋友一起看看吧2024-02-02
spring通過(guò)filter,Interceptor統(tǒng)一處理ResponseBody的返回值操作
這篇文章主要介紹了spring通過(guò)filter,Interceptor統(tǒng)一處理ResponseBody的返回值操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-09-09

