In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to realize the online fruit supermarket mall with Java. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Main technical implementation: spring, springmvc, redis, springboot, mybatis, session, jquery, md5, bootstarp.js tomcat, interceptor and so on.
Main function realization: front-end: login, registration, commodity classification view, browse fruit goods, order management, comment, collection goods, shopping cart management, personal order management view, personal information view and modification, address management, etc.
Background administrator: background login, data statistics, system version information, administrator management, role management, order management, notification announcement management, product category, and product detail management
Screenshots of the main features are as follows:
Users fill in the relevant information to register:
Fruit commodity data list view: you can also search for fruit commodity information according to keywords
Fruit commodity details management: click to view the purchase details of fruit goods, carry out quantity operation, add orders and shopping carts, collect items and view rankings and other functions
Details of my shopping cart: can settle accounts and continue shopping and delete shopping cart information and other operations
Order details Management:
My personal information management: password change, order view management, favorite view management, harvest address management
Check out my comments:
My collection; can remove the collection
The main implementation of the background administrator side: Super Admin admin login
The home page of the system: the main functions of users, roles, notification information, commodity types and data operations such as commodity details management and user management, as well as order information management.
Background menu management:
User Management:
Notification announcement list display and content addition:
Backstage administrator's management of fruit commodities:
Upload product details:
Commodity review data maintenance:
Order management and maintenance:
The project uses eclipse and idea to run, recommended idea, and source architecture:
Database design ER diagram:
Order information control layer:
@ 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 getOrder (String mno) {return orderInfoBiz.getOrder (mno) } @ RequestMapping ("/ getallOrder") @ ResponseBody public List getallOrder (String mno) {return orderInfoBiz.getallOrder (mno);} @ RequestMapping ("/ setStatus") @ ResponseBody public Integer setStatus (String ono) {System.out.println ("modify 1"); return orderInfoBiz.setStatus (ono) } @ RequestMapping ("/ getOrderByPage") @ ResponseBody public List 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;}}
Commodity management control layer:
@ Controller@RequestMapping ("/ goodsInfo") public class GoodsInfoController {@ Autowired private IGoodsInfoBiz goodsInfoBiz; @ RequestMapping ("/ findAll") @ ResponseBody public List 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 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 finds () {return goodsInfoBiz.finds ();} @ RequestMapping ("/ upload") @ ResponseBody public Map add (@ RequestParam ("upload") MultipartFile pic,HttpServletRequest request) {Map map = new HashMap () 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 } / / add a timestamp savePath + = "/" + new Date (). GetTime () + "_" + pic.getOriginalFilename () before the file name uploaded by the user; File dest = new File (new File (path). GetParentFile (), savePath) / / Save local images to the server 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 } / / merchandise information @ RequestMapping ("/ addGood") @ ResponseBody public int addGood (@ RequestParam Map map,@RequestParam MultipartFile pic, HttpServletRequest request) {int result=- 1; if (pic.isEmpty ()) {result=-2 / / No pictures need to be uploaded} 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) / / Save the picture to the specified folder on the server 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 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==0?total/10:total/10+1; return page;}}
Shopping cart information control layer:
@ Controller@RequestMapping ("/ cartInfo") public class CartInfoController {@ Autowired private ICartInfoBiz cartInfoBiz; @ RequestMapping ("/ finds") @ ResponseBody public List 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);}}
Management information control layer:
@ 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" / / starting with / from the project directory} @ RequestMapping ("/ findAll") @ ResponseBody public List 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 upload (MultipartFile pics, HttpServletRequest request, @ RequestParam Map 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) / / Save the picture to the specified file pics.transferTo (dest) on the server;} catch (IllegalStateException e) {e.printStackTrace ();} catch (IOException e) {e.printStackTrace () } params.put ("photo", savePath); if (adminInfoBiz.updatephoto (params) > 0) {Map map = new HashMap (); map.put ("savepath", savePath); return map } else {return Collections.emptyMap ();}} * /}
Menu information control layer:
@ 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 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 findAll () {return menberInfoBiz.findAll () } @ RequestMapping ("/ del") @ ResponseBody public int del (String mno) {return menberInfoBiz.del (mno) } / * @ RequestMapping ("/ upload") @ ResponseBody public Map upload (MultipartFile pics, HttpServletRequest request, @ RequestParam Map 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) / / Save the picture to the specified file pics.transferTo (dest) on the server;} catch (IllegalStateException e) {e.printStackTrace ();} catch (IOException e) {e.printStackTrace () } params.put ("photo", savePath); if (adminInfoBiz.updatephoto (params) > 0) {Map map = new HashMap (); map.put ("savepath", savePath); return map } else {return Collections.emptyMap () } * /} this is the end of the article on "how to realize online Fruit supermarket Mall by Java". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.