——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SpringBoot在线婚纱摄影预定系统(java+javaweb+ssm+springboot+mysql+thymeleaf+html+maven)
一、项目简述
功能:
前后用户的登录注册,婚纱照片分类,查看,摄影师预订
后台订单管理,图片管理等等
管理员:
http://localhost:8080/manage/login.html
admin 123456
前台用户:
http://localhost:8080
dddd/123456
二、项目运行
环境配置: Jdk1.8 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: Jdbc+ Servlert + html+ css + JavaScript + JQuery + Ajax + Fileupload
——————————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
| private static final Logger logger = LoggerFactory.getLogger(SpotsController.class); private ReturnResult returnResult = new ReturnResult();
@Resource(name = "spotsService") private ISpotsService spotsService;
@RequestMapping(value = "addSpots", method = RequestMethod.POST) @ResponseBody public ReturnResult addSpots(TSpots spots, HttpServletRequest request) { returnResult.setStatus(ReturnCodeType.FAILURE); try {
Map<String, String> map = OperationFileUtil.multiFileUpload(request, request.getServletContext().getRealPath("/") + "uploads/spots/"); String filePath = ""; for (Map.Entry<String, String> entry : map.entrySet()) { filePath = entry.getValue(); } filePath = filePath.replace(request.getServletContext().getRealPath("/"), "/"); spots.setPath(filePath); spots.setCreatetime(new Date()); spotsService.insert(spots); returnResult.setStatus(ReturnCodeType.SUCCESS); } catch (Exception e) { logger.error("新增spots失败" + e); } return returnResult;
}
@RequestMapping(value = "updateSpots", method = RequestMethod.POST) @ResponseBody public ReturnResult updateSpots(TSpots spots) { returnResult.setStatus(ReturnCodeType.FAILURE); 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
| @ResponseBody public ReturnResult updateLevel(TLevel level) { returnResult.setStatus(ReturnCodeType.FAILURE); try { levelService.updateBySQL("UPDATE t_level SET name='" + level.getName() + "', status="+level.getStatus()+" WHERE id=" + level.getId()); returnResult.setStatus(ReturnCodeType.SUCCESS); } catch (Exception e) { logger.error("修改level失败" + e); } return returnResult; }
@RequestMapping(value = "getLevelById", method = RequestMethod.POST) @ResponseBody public ReturnResult getLevelById(Integer id) { returnResult.setStatus(ReturnCodeType.FAILURE); try { returnResult.setStatus(ReturnCodeType.SUCCESS).setData(levelService.selectByPrimaryKey(id)); } catch (Exception e) { logger.error("根据id获取level失败" + e); } return returnResult; }
@RequestMapping(value = "getLevelListByPage", method = RequestMethod.POST) @ResponseBody public ReturnResult getLevelListByPage(PageVO page,String Status) { returnResult.setStatus(ReturnCodeType.FAILURE); try { Map<String, Object> resultMap = new HashMap<String, Object>(); StringBuffer sql = new StringBuffer("SELECT * FROM t_level WHERE 1=1"); StringBuffer countSql = new StringBuffer("SELECT COUNT(*) AS total FROM t_level WHERE 1=1"); if(StringUtils.isNotBlank(Status)){ sql.append(" AND status="+Status); countSql.append(" AND status="+Status); } List<Map<String, Object>> results = levelService.selectPageBySQL(sql.toString(), page.getPage() - 1, page.getRows()); if (!results.isEmpty() && results != null) { int total = Integer.valueOf(levelService.selectBySQL(countSql.toString()).get(0).get("total").toString()); int rows = page.getRows(); rows = rows == 0 ? 10 : rows; resultMap.put("total", (total % rows != 0 ? (total / rows + 1) : (total / rows))); resultMap.put("page", page.getPage());
|
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
| } return returnResult;
}
@RequestMapping(value = "deleteComment", method = RequestMethod.POST) @ResponseBody public ReturnResult deleteComment(Integer id) { returnResult.setStatus(ReturnCodeType.FAILURE); try {
commentService.deleteByPrimaryKey(id); returnResult.setStatus(ReturnCodeType.SUCCESS); } catch (Exception e) { logger.error("删除comment失败" + e); } return returnResult;
}
@RequestMapping(value = "getCommentByPid", method = RequestMethod.GET) @ResponseBody public ReturnResult getCommentByPid(Integer pid) { returnResult.setStatus(ReturnCodeType.FAILURE); try { returnResult.setStatus(ReturnCodeType.SUCCESS).setData(commentService.selectBySQL("SELECT a.`comment`,a.createTime,b.`name` FROM t_comment a,t_user b where a.userId=b.id AND a.photographerId="+pid)); } catch (Exception e) { logger.error("根据摄影师id查询评论" + e); } return returnResult; }
|
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
| * @return */ @RequestMapping(value = "getAllBanner") @ResponseBody public ReturnResult getAllBanner(PageVO page) { returnResult.setStatus(ReturnCodeType.FAILURE); try { Map<String, Object> resultMap = new HashMap<String, Object>(); StringBuffer sql = new StringBuffer("SELECT DISTINCT * FROM t_banner WHERE 1=1"); List<Map<String, Object>> results = bannerService.selectPageBySQL(sql.toString(), page.getPage() - 1, page.getRows()); if (!results.isEmpty() && results != null) { int total = bannerService.selectCount(new TBanner()); int rows = page.getRows(); rows = rows == 0 ? 10 : rows; resultMap.put("total", (total % rows != 0 ? (total / rows + 1) : (total / rows))); resultMap.put("page", page.getPage()); resultMap.put("records", total); resultMap.put("rows", results); returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap); } }catch (Exception e) { logger.error("分页获取banner失败" + e); } return returnResult; }
} package cc.gzvtc.photographer.controller;
|
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
| */ @RequestMapping(value = "addSpots", method = RequestMethod.POST) @ResponseBody public ReturnResult addSpots(TSpots spots, HttpServletRequest request) { returnResult.setStatus(ReturnCodeType.FAILURE); try {
Map<String, String> map = OperationFileUtil.multiFileUpload(request, request.getServletContext().getRealPath("/") + "uploads/spots/"); String filePath = ""; for (Map.Entry<String, String> entry : map.entrySet()) { filePath = entry.getValue(); } filePath = filePath.replace(request.getServletContext().getRealPath("/"), "/"); spots.setPath(filePath); spots.setCreatetime(new Date()); spotsService.insert(spots); returnResult.setStatus(ReturnCodeType.SUCCESS); } catch (Exception e) { logger.error("新增spots失败" + e); } return returnResult;
}
@RequestMapping(value = "updateSpots", method = RequestMethod.POST) @ResponseBody public ReturnResult updateSpots(TSpots spots) { returnResult.setStatus(ReturnCodeType.FAILURE); try { spotsService.updateBySQL("UPDATE t_spots SET name='" + spots.getName() + "',content='"+spots.getContent()+"', status="+spots.getStatus()+" WHERE id=" + spots.getId()); returnResult.setStatus(ReturnCodeType.SUCCESS); } catch (Exception e) { logger.error("修改spots失败" + e); } return returnResult; }
@RequestMapping(value = "getSpotsListByPage", method = RequestMethod.POST) @ResponseBody public ReturnResult getSpotsListByPage(PageVO page) { returnResult.setStatus(ReturnCodeType.FAILURE);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=481422272105200br
https://javayms.pages.dev?id=481422272105200br