——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Node.js≥14
开发工具 后端:eclipse/idea/myeclipse/sts等均可配置运行 前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot个人健康管理系统小程序微信小程序(java+springboot+maven+vue+wechat+mysql)
推荐使用:谷歌浏览器
后端启动类:StartApplication 前端启动命令:npm run serve
管理员(web端): admin 123456
用户(小程序端): a1 123456 a2 123456 a3 123456
——————————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 */ @RequestMapping("/page") public R page (@RequestParam Map<String, Object> params, HttpServletRequest request) { logger.debug("page方法:,,Controller:{},,params:{}" ,this .getClass().getName(),JSONObject.toJSONString(params)); String role = String.valueOf(request.getSession().getAttribute("role" )); if (false ) return R.error(511 ,"永不会进入" ); else if ("用户" .equals(role)) params.put("yonghuId" ,request.getSession().getAttribute("userId" )); CommonUtil.checkMap(params); PageUtils page = newsService.queryPage(params); List<NewsView> list =(List<NewsView>)page.getList(); for (NewsView c:list){ dictionaryService.dictionaryConvert(c, request); } return R.ok().put("data" , page); } @RequestMapping("/info/{id}") public R info (@PathVariable("id") Long id, HttpServletRequest request) { logger.debug("info方法:,,Controller:{},,id:{}" ,this .getClass().getName(),id); NewsEntity news = newsService.selectById(id); if (news !=null ){ NewsView view = new NewsView(); BeanUtils.copyProperties( news , view ); dictionaryService.dictionaryConvert(view, request); return R.ok().put("data" , view); }else { return R.error(511 ,"查不到数据" ); } }
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 YonghuEntity yonghu = yonghuService.selectById(id); if (yonghu !=null ){ YonghuView view = new YonghuView(); BeanUtils.copyProperties( yonghu , view ); dictionaryService.dictionaryConvert(view, request); return R.ok().put("data" , view); }else { return R.error(511 ,"查不到数据" ); } } @GetMapping(value = "logout") public R logout (HttpServletRequest request) { request.getSession().invalidate(); return R.ok("退出成功" ); } @IgnoreAuth @RequestMapping("/list") public R list (@RequestParam Map<String, Object> params, HttpServletRequest request) { logger.debug("list方法:,,Controller:{},,params:{}" ,this .getClass().getName(),JSONObject.toJSONString(params)); CommonUtil.checkMap(params); PageUtils page = yonghuService.queryPage(params); List<YonghuView> list =(List<YonghuView>)page.getList(); for (YonghuView c:list) dictionaryService.dictionaryConvert(c, request); return R.ok().put("data" , page); }
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 return R.ok(); } @RequestMapping("/update") public R update (@RequestBody UsersEntity user) { usersService.updateById(user); return R.ok(); } @RequestMapping("/delete") public R delete (@RequestBody Long[] ids) { List<UsersEntity> user = usersService.selectList(null ); if (user.size() > 1 ){ usersService.deleteBatchIds(Arrays.asList(ids)); }else { return R.error("管理员最少保留一个" ); } return R.ok(); } }
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 yundongCollection.setInsertTime(new Date()); yundongCollection.setCreateTime(new Date()); yundongCollectionService.insert(yundongCollection); return R.ok(); }else { return R.error(511 ,"表中有相同数据" ); } } @RequestMapping("/update") public R update (@RequestBody YundongCollectionEntity yundongCollection, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException { logger.debug("update方法:,,Controller:{},,yundongCollection:{}" ,this .getClass().getName(),yundongCollection.toString()); YundongCollectionEntity oldYundongCollectionEntity = yundongCollectionService.selectById(yundongCollection.getId()); String role = String.valueOf(request.getSession().getAttribute("role" )); yundongCollectionService.updateById(yundongCollection); return R.ok(); } @RequestMapping("/delete") public R delete (@RequestBody Integer[] ids, HttpServletRequest request) { logger.debug("delete:,,Controller:{},,ids:{}" ,this .getClass().getName(),ids.toString()); List<YundongCollectionEntity> oldYundongCollectionList =yundongCollectionService.selectBatchIds(Arrays.asList(ids)); yundongCollectionService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @RequestMapping("/batchInsert") public R save ( String fileName, HttpServletRequest request) { logger.debug("batchInsert方法:,,Controller:{},,fileName:{}" ,this .getClass().getName(),fileName); Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId" ))); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" ); try {
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 54 @RequestMapping("/save") public R save (@RequestBody GerentizhengEntity gerentizheng, HttpServletRequest request) { logger.debug("save方法:,,Controller:{},,gerentizheng:{}" ,this .getClass().getName(),gerentizheng.toString()); String role = String.valueOf(request.getSession().getAttribute("role" )); if (false ) return R.error(511 ,"永远不会进入" ); else if ("用户" .equals(role)) gerentizheng.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId" )))); if (gerentizheng.getTizhongNum() != null && gerentizheng.getGerentizhengNum() != null ){ double v = gerentizheng.getTizhongNum() / (gerentizheng.getGerentizhengNum() * gerentizheng.getGerentizhengNum()); if (v <= 18.4 ){ gerentizheng.setShentiTypes(1 ); }else if (v>=18.5 && v<=23.9 ){ gerentizheng.setShentiTypes(2 ); }else if (v>=24 && v<=27.9 ){ gerentizheng.setShentiTypes(3 ); }else { gerentizheng.setShentiTypes(4 ); } } gerentizheng.setGerentizhengDelete(1 ); gerentizheng.setInsertTime(new Date()); gerentizheng.setCreateTime(new Date()); gerentizhengService.insert(gerentizheng); return R.ok(); } @RequestMapping("/update") public R update (@RequestBody GerentizhengEntity gerentizheng, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException { logger.debug("update方法:,,Controller:{},,gerentizheng:{}" ,this .getClass().getName(),gerentizheng.toString()); GerentizhengEntity oldGerentizhengEntity = gerentizhengService.selectById(gerentizheng.getId()); String role = String.valueOf(request.getSession().getAttribute("role" )); if ("" .equals(gerentizheng.getMeishiPhoto()) || "null" .equals(gerentizheng.getMeishiPhoto())){ gerentizheng.setMeishiPhoto(null ); } gerentizhengService.updateById(gerentizheng); return R.ok(); }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=512224312204201lp https://javayms.pages.dev?id=512224312204201lp