——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot家政服务网站系统设计和实现(java+springboot+ssm+mysql+jsp+maven)
一、项目简述
本系统主要实现的功能有: 项目功能较多,包括用户的注册登录,家政0员务的查看, 分类,预订,以及支付,订单信息的查看,后台管理员的 人员管理,服务类别管理,订单分配,数据统计,家政维 护等等功能。
二、项目运行
1运行环境:
环境配置: Jdk1.8 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持) 项目技术: Springboot+ SpringMVC + MyBatis + ThymeLeaf + JavaScript + JQuery + Ajax + maven
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 } else { buffer.append("<a href =\ "index /cate ?number =" + (Integer.parseInt(number) - 1) + " &id =\ " + id + \"\"> 上一页</a > "); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("下一页"); } else { buffer.append("<a href =\ "index /cate ?number =" + (Integer.parseInt(number) + 1) + " &id =\ " + id + \"\"> 下一页</a > "); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("尾页"); } else { buffer.append("<a href =\ "index /cate ?number =" + (maxPage - 1) + " &id =\ " + id + \"\"> 尾页</a > "); } html = buffer.toString(); this.getRequest().setAttribute("html", html); this.getRequest().setAttribute("goodsList", goodsList); return "users/list"; } // 全部产品 @RequestMapping("/all") public String all(String number) { int pageSize = 10; this.front(); List<Goods > goodsList = new ArrayList<Goods > (); List<Goods > tempList = this.goodsService.getAllGoods(); int pageNumber = tempList.size(); int maxPage = pageNumber; if (maxPage % pageSize == 0) { maxPage = maxPage/pageSize; } else { maxPage = maxPage/pageSize + 1; } if (number == null) { number = "0"; } int start = Integer.parseInt(number) * pageSize; int over = (Integer.parseInt(number) + 1) * pageSize; int count = pageNumber - over; if (count <= 0) { over = pageNumber; } for (int i = start; i < over; i++) { Goods x = tempList.get(i); goodsList.add(x); } String html = ""; StringBuffer buffer = new StringBuffer(); buffer.append(" 共为"); buffer.append(maxPage); buffer.append("页 共有");
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 @RequestMapping("/getCateById") public String getCateById (String id) { Cate cate = this .cateService.getCateById(id); this .getRequest().setAttribute("cate" , cate); return "admin/editcate" ; } public CateService getCateService () { return cateService; } public void setCateService (CateService cateService) { this .cateService = cateService; } } package com.controller;@Controller public class SendCodeController { private String apiUrl = "https://sms_developer.zhenzikj.com" ; private String appId = "108850" ; private String appSecret = "NzhmN2JhNGQtNmRmOC00MWIwLTk1OGEtOTEyYzFiYjFlY2Vk" ; @ResponseBody @RequestMapping("/sendCode") public boolean getCode (String memPhone, HttpSession httpSession) { try { JSONObject json = null ; String code = String.valueOf(new Random().nextInt(999999 )); String pcode=null ; ZhenziSmsClient client = new ZhenziSmsClient(apiUrl, appId, appSecret); Map<String, Object> params = new HashMap<String, Object>();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 String end = this .getRequest().getParameter("end" ); long days = VeDate.getDays(end, start) + 1 ; JSONArray count = new JSONArray(); JSONArray day = new JSONArray(); for (int i = 0 ; i < days; i++) { String nxtDay = VeDate.getNextDay(start, "" + i); double total = 0 ; Orders orders = new Orders(); orders.setAddtime(nxtDay); List<Orders> list = this .ordersService.getOrdersByCond(orders); for (Orders b : list) { total += Double.parseDouble(b.getTotal()); } count.put(total); day.put(nxtDay); } JSONObject json = new JSONObject(); json.put("count" , count.toString()); json.put("days" , day.toString().replaceAll("\"" , "" )); return json.toString(); } @RequestMapping("/chartpie") @ResponseBody public String chartpie () throws JSONException { JSONArray count = new JSONArray(); JSONArray name = new JSONArray(); List<Goods> goodsList = this .goodsService.getAllGoods(); for (Goods goods : goodsList) { name.put(goods.getGoodsname()); count.put(Integer.parseInt(goods.getSellnum())); } JSONObject json = new JSONObject(); json.put("count" , count.toString()); json.put("names" , name.toString().replaceAll("\"" , "" )); return json.toString(); } @RequestMapping("/chartBar") @ResponseBody public String chartBar () throws JSONException { JSONArray name = new JSONArray(); JSONArray count = new JSONArray(); List<Cate> cateList = this .cateService.getAllCate(); for (Cate cate : cateList) { name.put(cate.getCatename()); int sum1 = 0 ; int sum2 = 0 ; int sum3 = 0 ; int sum4 = 0 ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 if (password.equals(users.getPassword())) { users.setPassword(repassword); this .usersService.updateUsers(users); } else { this .getSession().setAttribute("message" , "旧密码错误" ); return "redirect:/index/prePwd" ; } return "redirect:/index/prePwd" ; } @RequestMapping("/usercenter") public String usercenter () { this .front(); if (this .getSession().getAttribute("userid" ) == null ) { return "redirect:/index/preLogin" ; } return "users/usercenter" ; } @RequestMapping("/userinfo") public String userinfo () { this .front(); if (this .getSession().getAttribute("userid" ) == null ) { return "redirect:/index/preLogin" ; } String userid = (String) this .getSession().getAttribute("userid" ); this .getSession().setAttribute("users" , this .usersService.getUsersById(userid)); return "users/userinfo" ; } @RequestMapping("/personal") public String personal (Users users) { this .front(); if (this .getSession().getAttribute("userid" ) == null ) { return "redirect:/index/preLogin" ; } this .usersService.updateUsers(users); return "redirect:/index/userinfo" ; } @RequestMapping("/addcart") public String addcart () { this .front(); if (this .getSession().getAttribute("userid" ) == null ) { return "redirect:/index/preLogin" ; } String userid = (String) this .getSession().getAttribute("userid" ); Users users=usersService.getUsersById(userid);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 public void setAllotService (AllotService allotService) { this .allotService = allotService; } } package com.controller;@Controller @RequestMapping(value = "/goods", produces = "text/plain;charset=utf-8") public class GoodsController extends BaseController { @Autowired @Resource private GoodsService goodsService; @Autowired @Resource private CateService cateService; @RequestMapping("/createGoods") public String createGoods () { List<Cate> cateList = this .cateService.getAllCate(); this .getRequest().setAttribute("cateList" , cateList);
——————————PayStart——————————
项目链接: https://javayms.github.io?id=371422312105200ip https://javayms.pages.dev?id=371422312105200ip