当前位置:   article > 正文

基于javaweb+mysql的在线婚纱摄影预定系统(java+javaweb+SSM+springboot+mysql)_mysql婚礼定制

mysql婚礼定制

一、项目简述
功能: 前后用户的登录注册,婚纱照片分类,查看,摄影师预 订,后台订单管理,图片管理等等。

二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: Jdbc+ Servlert + html+ css + JavaScript + JQuery + Ajax + Fileupload请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

					page.getRows());
			if (!results.isEmpty() && results != null) {
				int total = Integer.valueOf(worksService.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());
				resultMap.put("records", total);
				resultMap.put("rows", results);
				returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap);
			}
		}catch (Exception e) {
			logger.error("分页获取works失败" + e);
		}
		return returnResult;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
				resultMap.put("rows", results);
				returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap);
			}
		} catch (Exception e) {
			logger.error("分页获取photographer失败" + e);
		}
		return returnResult;
	}
	/**
	 * 分页获取启用的photographer
	 * 
	 * @return
	 */
	@RequestMapping(value = "getPhotographerListByPageStatus", method = RequestMethod.POST)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
	
	/**
	 * 分页获取works
	 * @return
	 */
	@RequestMapping(value = "getWorksListByPage", method = RequestMethod.POST)
	@ResponseBody
	public ReturnResult getWorksListByPage(PageVO page,String photographerId,String spotsId,String status) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			Map<String, Object> resultMap = new HashMap<String, Object>();
			StringBuffer sql = new StringBuffer("SELECT a.*,b.`name` AS photographer,c.`name` AS spots FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");
			StringBuffer countSql = new StringBuffer("SELECT COUNT(*) AS total FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");
			if(StringUtils.isNotBlank(photographerId)){
				sql.append(" AND b.id="+photographerId);
				countSql.append(" AND b.id="+photographerId);
			}
			if(StringUtils.isNotBlank(spotsId)){
				sql.append(" AND c.id="+spotsId);
				countSql.append(" AND c.id="+spotsId);
			}
			if(StringUtils.isNotBlank(status)){
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
	}
	
	/**
	 * 分页获取works
	 * @return
	 */
	@RequestMapping(value = "getWorksListByPage", method = RequestMethod.POST)
	@ResponseBody
	public ReturnResult getWorksListByPage(PageVO page,String photographerId,String spotsId,String status) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			Map<String, Object> resultMap = new HashMap<String, Object>();
			StringBuffer sql = new StringBuffer("SELECT a.*,b.`name` AS photographer,c.`name` AS spots FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");
			StringBuffer countSql = new StringBuffer("SELECT COUNT(*) AS total FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");
			if(StringUtils.isNotBlank(photographerId)){
				sql.append(" AND b.id="+photographerId);
				countSql.append(" AND b.id="+photographerId);
			}
			if(StringUtils.isNotBlank(spotsId)){
				sql.append(" AND c.id="+spotsId);
				countSql.append(" AND c.id="+spotsId);
			}
			if(StringUtils.isNotBlank(status)){
				sql.append(" AND a.status="+status);
				countSql.append(" AND a.status="+status);
			}
			List<Map<String, Object>> results = worksService.selectPageBySQL(sql.toString(), page.getPage() - 1,
  • 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
		return returnResult;
	}
	/**
	 * 修改photographer的name和summary
	 * 
	 * @param photographer
	 * @return
	 */
	@RequestMapping(value = "updatePhotographer", method = RequestMethod.POST)
	@ResponseBody
	public ReturnResult updatePhotographer(TPhotographer photographer, Integer labelId, Integer levelId,
			Integer spotsId) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			photographerService.updateBySQL("UPDATE t_photographer SET name='" + photographer.getName() + "',summary='"
					+ photographer.getSummary() + "',status=" + photographer.getStatus() + " WHERE id="
					+ photographer.getId());
			photographerLabelService.updateBySQL("UPDATE t_photographer_label SET labelId=" + labelId
					+ " WHERE photographerId=" + photographer.getId());
			photographerLevelService.updateBySQL("UPDATE t_photographer_level SET levelId=" + levelId
					+ " WHERE photographer=" + photographer.getId());
			photographerSpotsService.updateBySQL("UPDATE t_photographer_spots SET spotsId=" + spotsId
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
	@ResponseBody
	public ReturnResult getWorksById(Integer id) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.selectByPrimaryKey(id));
		} catch (Exception e) {
			logger.error("根据id获取Works失败" + e);
		}
		return returnResult;
	}
	/**
	 * 根据id获取Works 用户视图
	 * @param Works
	 * @return
	 */
	@RequestMapping(value = "getWorks")
	@ResponseBody
	public ReturnResult getWorks(Integer id) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.getWorks(id));
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
		}
		return returnResult;
	}
	
	/**
	 * 根据id获取Works 
	 * @param Works
	 * @return
	 */
	@RequestMapping(value = "getWorksById")
	@ResponseBody
	public ReturnResult getWorksById(Integer id) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.selectByPrimaryKey(id));
		} catch (Exception e) {
			logger.error("根据id获取Works失败" + e);
		}
		return returnResult;
	}
	/**
	 * 根据id获取Works 用户视图
	 * @param Works
	 * @return
	 */
  • 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
	@RequestMapping(value = "getWorksListByPage", method = RequestMethod.POST)
	@ResponseBody
	public ReturnResult getWorksListByPage(PageVO page,String photographerId,String spotsId,String status) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			Map<String, Object> resultMap = new HashMap<String, Object>();
			StringBuffer sql = new StringBuffer("SELECT a.*,b.`name` AS photographer,c.`name` AS spots FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");
			StringBuffer countSql = new StringBuffer("SELECT COUNT(*) AS total FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");
			if(StringUtils.isNotBlank(photographerId)){
				sql.append(" AND b.id="+photographerId);
				countSql.append(" AND b.id="+photographerId);
			}
			if(StringUtils.isNotBlank(spotsId)){
				sql.append(" AND c.id="+spotsId);
				countSql.append(" AND c.id="+spotsId);
			}
			if(StringUtils.isNotBlank(status)){
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
				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("分页获取works失败" + e);
		}
		return returnResult;
	}
	/**
	 * 分页获取启用的works
	 * @return
	 */
	@RequestMapping(value = "getWorksListByPageStatus", method = RequestMethod.POST)
	@ResponseBody
	public ReturnResult getWorksListByPageStatus(String sord,String spotsId) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			String sql = "SELECT * FROM t_works WHERE status=0";
			if(StringUtils.isNotBlank(sord)){
				sql="SELECT * FROM t_works WHERE status=0 ORDER BY id DESC";
			}
  • 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
	@ResponseBody
	public ReturnResult getPhotographer(Integer id) {
		returnResult.setStatus(ReturnCodeType.FAILURE);
		try {
			returnResult.setStatus(ReturnCodeType.SUCCESS)
			.setData(photographerService.selectBySQL(
					"SELECT a.name,a.head,a.summary,d.`name` AS level,e.`name` AS spots FROM t_photographer a,t_photographer_level b,t_photographer_spots c,t_level d,t_spots e WHERE a.id="+id+" AND b.photographer="+id+" AND c.photographerId="+id+" AND d.id=b.levelId AND e.id = c.spotsId AND a.`status`=0")
					.get(0));
		} catch (Exception e) {
			logger.error("根据id获取Photographer失败" + e);
		}
		return returnResult;
	}
	/**
	 * 分页获取photographer
	 * 
	 * @return
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/792134
推荐阅读
相关标签
  

闽ICP备14008679号