——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SpringBoot网上书城管理系统(java+springboot+maven+mybaits+vue+elementui+mysql)
项目介绍
基于SpringBoot Vue的网上书城
角色:管理员、用户、
管理员:管理员登录系统后,可以对首页、个人中心、用户管理、图书类型管理、图书分类管理、图书信息管理、我的收藏管理、系统管理、订单管理等功能
用户:用户登录进入系统后台,可以对首页、个人中心、我的收藏管理、订单管理等功能
后端: SpringBoot+Mybaits
前端:Vue +ElementUI +Layui +HTML+CSS+JS
——————————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
| @RequestMapping("/update") public R update(@RequestBody TushuxinxiEntity tushuxinxi, HttpServletRequest request){ tushuxinxiService.updateById(tushuxinxi); return R.ok(); }
@RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ tushuxinxiService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); }
@RequestMapping("/remind/{columnName}/{type}") public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) { map.put("column", columnName); map.put("type", type); if(type.equals("2")) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar c = Calendar.getInstance(); Date remindStartDate = null; Date remindEndDate = null; if(map.get("remindstart")!=null) { Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart); remindStartDate = c.getTime(); map.put("remindstart", sdf.format(remindStartDate)); } if(map.get("remindend")!=null) { Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindEnd); remindEndDate = c.getTime(); map.put("remindend", sdf.format(remindEndDate)); } }
|
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
|
@RestController @RequestMapping("file") @SuppressWarnings({"unchecked","rawtypes"}) public class FileController{ @Autowired private ConfigService configService;
@RequestMapping("/upload") public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception { if (file.isEmpty()) { throw new EIException("上传文件不能为空"); } String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); File path = new File(ResourceUtils.getURL("classpath:static").getPath()); if(!path.exists()) { path = new File(""); } File upload = new File(path.getAbsolutePath(),"/upload/"); if(!upload.exists()) { upload.mkdirs(); } String fileName = new Date().getTime()+"."+fileExt; File dest = new File(upload.getAbsolutePath()+"/"+fileName); file.transferTo(dest);
if(StringUtils.isNotBlank(type) && type.equals("1")) { ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile")); if(configEntity==null) { configEntity = new ConfigEntity(); configEntity.setName("faceFile"); configEntity.setValue(fileName); } else { configEntity.setValue(fileName);
|
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
| @Autowired private OrdersService ordersService;
@RequestMapping("/page") public R page(@RequestParam Map<String, Object> params,TushuxinxiEntity tushuxinxi, HttpServletRequest request){ EntityWrapper<TushuxinxiEntity> ew = new EntityWrapper<TushuxinxiEntity>(); PageUtils page = tushuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tushuxinxi), params), params));
return R.ok().put("data", page); }
@IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params,TushuxinxiEntity tushuxinxi, HttpServletRequest request){ EntityWrapper<TushuxinxiEntity> ew = new EntityWrapper<TushuxinxiEntity>(); PageUtils page = tushuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tushuxinxi), params), params)); return R.ok().put("data", page); }
@RequestMapping("/lists") public R list( TushuxinxiEntity tushuxinxi){ EntityWrapper<TushuxinxiEntity> ew = new EntityWrapper<TushuxinxiEntity>(); ew.allEq(MPUtil.allEQMapPre( tushuxinxi, "tushuxinxi")); return R.ok().put("data", tushuxinxiService.selectListView(ew)); }
|
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
| params.put("parent", parent); } List<String> data = commonService.getOption(params); return R.ok().put("data", data); }
@IgnoreAuth @RequestMapping("/follow/{tableName}/{columnName}") public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) { Map<String, Object> params = new HashMap<String, Object>(); params.put("table", tableName); params.put("column", columnName); params.put("columnValue", columnValue); Map<String, Object> result = commonService.getFollowByOption(params); return R.ok().put("data", result); }
@RequestMapping("/sh/{tableName}") public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) { map.put("table", tableName); commonService.sh(map); return R.ok(); }
@IgnoreAuth @RequestMapping("/remind/{tableName}/{columnName}/{type}")
|
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
| * (按值统计)时间统计类型 */ @IgnoreAuth @RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType}") public R valueDay(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType) { Map<String, Object> params = new HashMap<String, Object>(); params.put("table", tableName); params.put("xColumn", xColumnName); params.put("yColumn", yColumnName); params.put("timeStatType", timeStatType); List<Map<String, Object>> result = commonService.selectTimeStatValue(params); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); for(Map<String, Object> m : result) { for(String k : m.keySet()) { if(m.get(k) instanceof Date) { m.put(k, sdf.format((Date)m.get(k))); } } } return R.ok().put("data", result); } }
|
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
|
@RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}") public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) { Map<String, Object> params = new HashMap<String, Object>(); params.put("xColumn", xColumnName); params.put("yColumn", yColumnName); params.put("timeStatType", timeStatType); EntityWrapper<TushuxinxiEntity> ew = new EntityWrapper<TushuxinxiEntity>(); List<Map<String, Object>> result = tushuxinxiService.selectTimeStatValue(params, ew); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); for(Map<String, Object> m : result) { for(String k : m.keySet()) { if(m.get(k) instanceof Date) { m.put(k, sdf.format((Date)m.get(k))); } } } return R.ok().put("data", result); }
@RequestMapping("/group/{columnName}") public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) { Map<String, Object> params = new HashMap<String, Object>(); params.put("column", columnName); EntityWrapper<TushuxinxiEntity> ew = new EntityWrapper<TushuxinxiEntity>(); List<Map<String, Object>> result = tushuxinxiService.selectGroup(params, ew); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); for(Map<String, Object> m : result) { for(String k : m.keySet()) { if(m.get(k) instanceof Date) { m.put(k, sdf.format((Date)m.get(k))); } } } return R.ok().put("data", result); }
}
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=111524190701201jv
https://javayms.pages.dev?id=111524190701201jv