基于javaweb+mysql的ssm演唱会售票管理系统(java+ssm+jsp+javascript+jquery+mysql)

基于javaweb+mysql的ssm演唱会售票管理系统(java+ssm+jsp+javascript+jquery+mysql)

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

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

功能说明

基于javaweb的SSM演唱会售票管理系统(java+ssm+jsp+javascript+jquery+mysql)

项目介绍

本项目分为前后台,前台为普通用户登录,后台为管理员登录; 管理员角色包含以下功能: 管理员登录,管理员信息管理,网站用户信息管理,新闻公告信息管理,演唱会类型信息管理,城市信息管理,剧场信息管理,演唱会信息管理,订单信息管理等功能。

用户角色包含以下功能: 用户登录,按分类查看,查看演唱会详情,加入购物车,提交订单,查看我的订单,修改个人信息,提交评论,演唱会评价信息管理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入http://localhost:8080/ 登录 用户账号/密码: user/123456 管理员账号/密码:admin/admin
			buffer.append("页  ");
			if ((Integer.parseInt(number) + 1) == 1) {
				buffer.append("首页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=0\">首页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if ((Integer.parseInt(number) + 1) == 1) {
				buffer.append("上一页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if (maxPage <= (Integer.parseInt(number) + 1)) {
				buffer.append("下一页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if (maxPage <= (Integer.parseInt(number) + 1)) {
				buffer.append("尾页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=" + (maxPage - 1) + "\">尾页</a>");
			}
			html = buffer.toString();
			this.getRequest().setAttribute("html", html);
			this.getRequest().setAttribute("flimList", flimList);
			return "users/list";
		}

	// 全部产品
	@RequestMapping("all.action")
	public String all(String number) {
		this.front();
		List<Jiancai> flimList = new ArrayList<Jiancai>();
		List<Jiancai> tempList = this.jiancaiService.getAllJiancai();
		int pageNumber = tempList.size();
		int maxPage = pageNumber;
		if (maxPage % 12 == 0) {
			maxPage = maxPage / 12;
		} else {
			maxPage = maxPage / 12 + 1;
		}
		if (number == null) {
			number = "0";
		}
		int start = Integer.parseInt(number) * 12;
		int over = (Integer.parseInt(number) + 1) * 12;
		int count = pageNumber - over;
		if (count <= 0) {
			over = pageNumber;
		}
		for (int i = start; i < over; i++) {
			Jiancai x = tempList.get(i);
		String[] ids = this.getRequest().getParameterValues("cateid");
		for (String cateid : ids) {
			this.cateService.deleteCate(cateid);
		}
		return "redirect:/cate/getAllCate.action";
	}

	// 更新数据
	@RequestMapping("updateCate.action")
	public String updateCate(Cate cate) {
		this.cateService.updateCate(cate);
		return "redirect:/cate/getAllCate.action";
	}

	// 显示全部数据
	@RequestMapping("getAllCate.action")
	public String getAllCate(String number) {
		List<Cate> cateList = this.cateService.getAllCate();
		PageHelper.getPage(cateList, "cate", null, null, 10, number, this.getRequest(), null);
		return "admin/listcate";
	}

	// 按条件查询数据 (模糊查询)
	@RequestMapping("queryCateByCond.action")
	public String queryCateByCond(String cond, String name, String number) {
		Cate cate = new Cate();
		if (cond != null) {
			if ("catename".equals(cond)) {
				cate.setCatename(name);
			}
			if ("memo".equals(cond)) {
				cate.setMemo(name);
			}
			if ("addtime".equals(cond)) {
				cate.setAddtime(name);
			}
		}

		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
	private CateService cateService;
	@Autowired
	@Resource
	private CityService cityService;
	@Autowired
	@Resource
	private PeihuoService peihuoService;
	@Autowired
	@Resource
	private JiancaiService jiancaiService;
	@Autowired
	@Resource
	private CartService cartService;
	@Autowired
	@Resource
	private OrdersService ordersService;
	@Autowired
	@Resource
	private DetailsService detailsService;
	@Autowired
	@Resource
	private TopicService topicService;

	// 公共方法 提供公共查询数据
	private void front() {
		this.getRequest().setAttribute("title", "优品演唱会网-力作中国最大的演唱会网站");
		List<Cate> cateList = this.cateService.getAllCate();
		this.getRequest().setAttribute("cateList", cateList);
		List<Jiancai> hotList = this.jiancaiService.getJiancaiByHot();
		Collections.shuffle(hotList);
		this.getRequest().setAttribute("hotList", hotList);
	}

	// 首页显示
		@RequestMapping("index.action")
		public String index() {
			this.front();
			List<Cate> cateList = this.cateService.getCateFront();
			List<Cate> frontList = new ArrayList<Cate>();
			for (Cate cate : cateList) {
				List<Jiancai> flimList = this.jiancaiService.getJiancaiByCate(cate.getCateid());
				cate.setFlimList(flimList);
				frontList.add(cate);
			}
			this.getRequest().setAttribute("frontList", frontList);
			return "users/index";
		}
	public String deleteCateByIds() {
		String[] ids = this.getRequest().getParameterValues("cateid");
		for (String cateid : ids) {
			this.cateService.deleteCate(cateid);
		}
		return "redirect:/cate/getAllCate.action";
	}

	// 更新数据
	@RequestMapping("updateCate.action")
	public String updateCate(Cate cate) {
		this.cateService.updateCate(cate);
		return "redirect:/cate/getAllCate.action";
	}

	// 显示全部数据
	@RequestMapping("getAllCate.action")
	public String getAllCate(String number) {
		List<Cate> cateList = this.cateService.getAllCate();
		PageHelper.getPage(cateList, "cate", null, null, 10, number, this.getRequest(), null);
		return "admin/listcate";
	}

	// 按条件查询数据 (模糊查询)
	@RequestMapping("queryCateByCond.action")
	public String queryCateByCond(String cond, String name, String number) {
		Cate cate = new Cate();
		if (cond != null) {
			if ("catename".equals(cond)) {
				cate.setCatename(name);
			}
			if ("memo".equals(cond)) {
				cate.setMemo(name);
			}
			if ("addtime".equals(cond)) {
				cate.setAddtime(name);
			}
		}

		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
		valueList.add(name);
		PageHelper.getPage(this.cateService.getCateByLike(cate), "cate", nameList, valueList, 10, number, this.getRequest(), "query");
		name = null;
		cond = null;
		return "admin/querycate";
	}

	// 按主键查询数据
	@RequestMapping("getCateById.action")
	public String getCateById(String id) {
@RequestMapping("addUsers.action")
public String addUsers(Users users) {
users.setRegdate(VeDate.getStringDateShort());
this.usersService.insertUsers(users);
return "redirect:/users/createUsers.action";
}

// 通过主键删除数据
@RequestMapping("deleteUsers.action")
public String deleteUsers(String id) {
this.usersService.deleteUsers(id);
return "redirect:/users/getAllUsers.action";
}

// 批量删除数据
@RequestMapping("deleteUsersByIds.action")
public String deleteUsersByIds() {
String[] ids = this.getRequest().getParameterValues("usersid");
for (String usersid : ids) {
this.usersService.deleteUsers(usersid);
}
return "redirect:/users/getAllUsers.action";
}

// 更新数据
@RequestMapping("updateUsers.action")
public String updateUsers(Users users) {
this.usersService.updateUsers(users);
return "redirect:/users/getAllUsers.action";
}
// 显示全部数据
@RequestMapping("getAllUsers.action")
public String getAllUsers(String number) {
List<Users> usersList = this.usersService.getAllUsers();
PageHelper.getPage(usersList, "users", null, null, 10, number, this.getRequest(), null);
return "admin/listusers";
}

// 按条件查询数据 (模糊查询)
@RequestMapping("queryUsersByCond.action")
public String queryUsersByCond(String cond, String name, String number) {
Users users = new Users();
if(cond != null){
if ("username".equals(cond)) {
users.setUsername(name);
}
if ("password".equals(cond)) {
users.setPassword(name);
}
if ("realname".equals(cond)) {
users.setRealname(name);
}
if ("sex".equals(cond)) {
users.setSex(name);
	public String createJiancai() {
		List<Cate> cateList = this.cateService.getAllCate();
		this.getRequest().setAttribute("cateList", cateList);
		return "admin/addjiancai";
	}

	// 添加数据
	@RequestMapping("addJiancai.action")
	public String addJiancai(Jiancai jiancai) {
		jiancai.setHits("0");
		jiancai.setSellnum("0");
		this.jiancaiService.insertJiancai(jiancai);
		return "redirect:/jiancai/createJiancai.action";
	}

	// 通过主键删除数据
	@RequestMapping("deleteJiancai.action")
	public String deleteJiancai(String id) {
		this.jiancaiService.deleteJiancai(id);
		return "redirect:/jiancai/getAllJiancai.action";
	}

	// 批量删除数据
	@RequestMapping("deleteJiancaiByIds.action")
	public String deleteJiancaiByIds() {
		String[] ids = this.getRequest().getParameterValues("jiancaiid");
		for (String jiancaiid : ids) {
			this.jiancaiService.deleteJiancai(jiancaiid);
		}
		return "redirect:/jiancai/getAllJiancai.action";
	}

	// 更新数据
	@RequestMapping("updateJiancai.action")
	public String updateJiancai(Jiancai jiancai) {
		this.jiancaiService.updateJiancai(jiancai);
		return "redirect:/jiancai/getAllJiancai.action";
	}

	// 显示全部数据
	@RequestMapping("getAllJiancai.action")
	public String getAllJiancai(String number) {
		List<Jiancai> jiancaiList = this.jiancaiService.getAllJiancai();
		PageHelper.getPage(jiancaiList, "jiancai", null, null, 10, number, this.getRequest(), null);
		return "admin/listjiancai";
	}

	// 通过主键删除数据
	@RequestMapping("deleteCity.action")
	public String deleteCity(String id) {
		this.cityService.deleteCity(id);
		return "redirect:/city/getAllCity.action";
	}

	// 批量删除数据
	@RequestMapping("deleteCityByIds.action")
	public String deleteCityByIds() {
		String[] ids = this.getRequest().getParameterValues("cityid");
		for (String cityid : ids) {
			this.cityService.deleteCity(cityid);
		}
		return "redirect:/city/getAllCity.action";
	}

	// 更新数据
	@RequestMapping("updateCity.action")
	public String updateCity(City city) {
		this.cityService.updateCity(city);
		return "redirect:/city/getAllCity.action";
	}

	// 显示全部数据
	@RequestMapping("getAllCity.action")
	public String getAllCity(String number) {
		List<City> cityList = this.cityService.getAllCity();
		PageHelper.getPage(cityList, "city", null, null, 10, number, this.getRequest(), null);
		return "admin/listcity";
	}

	// 按条件查询数据 (模糊查询)
	@RequestMapping("queryCityByCond.action")
	public String queryCityByCond(String cond, String name, String number) {
		City city = new City();
		if (cond != null) {
			if ("cityname".equals(cond)) {
				city.setCityname(name);
			}
		}

		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();

	// 准备添加数据
	@RequestMapping("createPeihuo.action")
	public String createPeihuo() {
		List<City> cityList = this.cityService.getAllCity();
		this.getRequest().setAttribute("cityList", cityList);
		return "admin/addpeihuo";
	}

	// 添加数据
	@RequestMapping("addPeihuo.action")
	public String addPeihuo(Peihuo peihuo) {
		this.peihuoService.insertPeihuo(peihuo);
		return "redirect:/peihuo/createPeihuo.action";
	}

	// 通过主键删除数据
	@RequestMapping("deletePeihuo.action")
	public String deletePeihuo(String id) {
		this.peihuoService.deletePeihuo(id);
		return "redirect:/peihuo/getAllPeihuo.action";
	}

	// 批量删除数据
	@RequestMapping("deletePeihuoByIds.action")
	public String deletePeihuoByIds() {
		String[] ids = this.getRequest().getParameterValues("peihuoid");
		for (String peihuoid : ids) {
			this.peihuoService.deletePeihuo(peihuoid);
		}
		return "redirect:/peihuo/getAllPeihuo.action";
	}

	// 更新数据
	@RequestMapping("updatePeihuo.action")
	public String updatePeihuo(Peihuo peihuo) {
		this.peihuoService.updatePeihuo(peihuo);
		return "redirect:/peihuo/getAllPeihuo.action";
	}

	// 显示全部数据
		@RequestMapping("getAllPeihuo.action")
		public String getAllPeihuo(String number) {
			List<Peihuo> peihuoList = this.peihuoService.getAllPeihuo();
			PageHelper.getPage(peihuoList, "peihuo", null, null, 10, number, this.getRequest(), null);
			return "admin/listpeihuo";
		}
		
		// 显示全部数据
		@RequestMapping("getNetWork.action")
		public String getNetWork(String number) {
			List<Peihuo> peihuoList = this.peihuoService.getAllPeihuo();
			PageHelper.getPage(peihuoList, "peihuo", null, null, 10, number, this.getRequest(), null);
		}
		return "admin/main";
	}

	// 修改密码
	@RequestMapping("editpwd.action")
	public String editpwd() {
		String adminid = (String) this.getSession().getAttribute("adminid");
		String password = this.getRequest().getParameter("password");
		String repassword = this.getRequest().getParameter("repassword");
		Admin admin = this.adminService.getAdminById(adminid);
		if (password.equals(admin.getPassword())) {
			admin.setPassword(repassword);
			this.adminService.updateAdmin(admin);
		} else {
			this.getRequest().setAttribute("message", "旧密码错误");
		}
		return "admin/editpwd";
	}

	// 管理员退出登录
	@RequestMapping("exit.action")
	public String exit() {
		this.getSession().removeAttribute("adminid");
		this.getSession().removeAttribute("adminname");
		this.getSession().removeAttribute("realname");
		return "admin/index";
	}

	// 准备添加数据
	@RequestMapping("createAdmin.action")
	public String createAdmin() {
		return "admin/addadmin";
	}

	// 添加数据
	@RequestMapping("addAdmin.action")
	public String addAdmin(Admin admin) {
		admin.setAddtime(VeDate.getStringDateShort());
		this.adminService.insertAdmin(admin);
		return "redirect:/admin/createAdmin.action";
	}
orders.setOrdercode(name);
}
if ("username".equals(cond)) {
orders.setUsername(name);
}
if ("total".equals(cond)) {
orders.setTotal(name);
}
if ("status".equals(cond)) {
orders.setStatus(name);
}
if ("addtime".equals(cond)) {
orders.setAddtime(name);
}
}

List<String> nameList = new ArrayList<String>();
List<String> valueList = new ArrayList<String>();
nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.ordersService.getOrdersByLike(orders), "orders", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
cond = null;
return "admin/queryorders";
}

// 按主键查询数据
@RequestMapping("getOrdersById.action")
public String getOrdersById(String id ) {
Orders orders = this.ordersService.getOrdersById(id);
this.getRequest().setAttribute("orders", orders);
List<Users> usersList = this.usersService.getAllUsers();
this.getRequest().setAttribute("usersList", usersList);
return "admin/editorders";
}

public OrdersService getOrdersService() { return ordersService; }

public void setOrdersService(OrdersService ordersService) { this.ordersService = ordersService; }

}
	public String createDetails() {
		List<Jiancai> jiancaiList = this.jiancaiService.getAllJiancai();
		this.getRequest().setAttribute("jiancaiList", jiancaiList);
		List<City> cityList = this.cityService.getAllCity();
		this.getRequest().setAttribute("cityList", cityList);
		List<Peihuo> peihuoList = this.peihuoService.getAllPeihuo();
		this.getRequest().setAttribute("peihuoList", peihuoList);
		return "admin/adddetails";
	}

	// 添加数据
	@RequestMapping("addDetails.action")
	public String addDetails(Details details) {
		this.detailsService.insertDetails(details);
		return "redirect:/details/createDetails.action";
	}

	// 通过主键删除数据
	@RequestMapping("deleteDetails.action")
	public String deleteDetails(String id) {
		this.detailsService.deleteDetails(id);
		return "redirect:/details/getAllDetails.action";
	}

	// 批量删除数据
	@RequestMapping("deleteDetailsByIds.action")
	public String deleteDetailsByIds() {
		String[] ids = this.getRequest().getParameterValues("detailsid");
		for (String detailsid : ids) {
			this.detailsService.deleteDetails(detailsid);
		}
		return "redirect:/details/getAllDetails.action";
	}

	// 更新数据
	@RequestMapping("updateDetails.action")
	public String updateDetails(Details details) {
		this.detailsService.updateDetails(details);
		return "redirect:/details/getAllDetails.action";
	}

	// 显示全部数据
	@RequestMapping("getAllDetails.action")
	public String getAllDetails(String number) {
		List<Details> detailsList = this.detailsService.getAllDetails();
		PageHelper.getPage(detailsList, "details", null, null, 10, number, this.getRequest(), null);
		return "admin/listdetails";
	}

	// 按条件查询数据 (模糊查询)
	@RequestMapping("queryDetailsByCond.action")
	public String queryDetailsByCond(String cond, String name, String number) {
		} else {
			buffer.append("<a href=\"index/all.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("下一页");
		} else {
			buffer.append("<a href=\"index/all.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("尾页");
		} else {
			buffer.append("<a href=\"index/all.action?number=" + (maxPage - 1) + "\">尾页</a>");
		}
		html = buffer.toString();
		this.getRequest().setAttribute("html", html);
		this.getRequest().setAttribute("flimList", flimList);
		return "users/list";
	}

	// 查询演唱会
	@RequestMapping("query.action")
	public String query(String name) {
		this.front();
		Jiancai goods = new Jiancai();
		goods.setJiancainame(name);
		List<Jiancai> flimList = this.jiancaiService.getJiancaiByLike(goods);
		this.getRequest().setAttribute("flimList", flimList);
		return "users/list";
	}

	// 演唱会详情
	@RequestMapping("detail.action")
	public String detail(String id) {
		this.front();
		Jiancai goods = this.jiancaiService.getJiancaiById(id);
		goods.setHits("" + (Integer.parseInt(goods.getHits()) + 1));
		this.jiancaiService.updateJiancai(goods);
		this.getRequest().setAttribute("goods", goods);
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Topic topic = new Topic();
		topic.setJiancaiid(id);
		List<Topic> topicList = this.topicService.getTopicByCond(topic);
		this.getRequest().setAttribute("topicList", topicList);
		this.getRequest().setAttribute("tnum", topicList.size());
		return "users/detail";
	}

	@RequestMapping("addTopic.action")
	public String addTopic(Topic topic) {
		} catch (Exception e) {
			e.printStackTrace();
		}
		model.addAttribute("imageFileName", fileName);
		return "saveimage";
	}

	@RequestMapping(value = "/files.action")
	public String files(@RequestParam(value = "image", required = false) MultipartFile file, HttpServletRequest request,
			ModelMap model) {
		String path = request.getSession().getServletContext().getRealPath("/") + "upfiles/";
		String fileName = file.getOriginalFilename();
		int i = fileName.lastIndexOf(".");
		String name = String.valueOf(VeDate.getStringDatex());
		String type = fileName.substring(i + 1);
		fileName = name + "." + type;
		File targetFile = new File(path, fileName);
		if (!targetFile.exists()) {
			targetFile.mkdirs();
		}

		// 保存
		try {
			file.transferTo(targetFile);
		} catch (Exception e) {
			e.printStackTrace();
		}
		model.addAttribute("imageFileName", fileName);
		return "savefile";
	}
}

		goods.setCateid(id);
		List<Jiancai> flimList = new ArrayList<Jiancai>();
		List<Jiancai> tempList = this.jiancaiService.getJiancaiByCond(goods);
		int pageNumber = tempList.size();
		int maxPage = pageNumber;
		if (maxPage % 12 == 0) {
			maxPage = maxPage / 12;
		} else {
			maxPage = maxPage / 12 + 1;
		}
		if (number == null) {
			number = "0";
		}
		int start = Integer.parseInt(number) * 12;
		int over = (Integer.parseInt(number) + 1) * 12;
		int count = pageNumber - over;
		if (count <= 0) {
			over = pageNumber;
		}
		for (int i = start; i < over; i++) {
			Jiancai x = tempList.get(i);
			flimList.add(x);
		}
		String html = "";
		StringBuffer buffer = new StringBuffer();
		buffer.append("&nbsp;&nbsp;共为");
		buffer.append(maxPage);
		buffer.append("页&nbsp; 共有");
		buffer.append(pageNumber);
		buffer.append("条&nbsp; 当前为第");
		buffer.append((Integer.parseInt(number) + 1));
		buffer.append("页 &nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("首页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=0&id=\" + id+ \"\">首页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("上一页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=" + (Integer.parseInt(number) - 1) + "&id=\" + id+ \"\">上一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("下一页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=" + (Integer.parseInt(number) + 1) + "&id=\" + id+ \"\">下一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("尾页");
		} else {
			admin.setPassword(repassword);
			this.adminService.updateAdmin(admin);
		} else {
			this.getRequest().setAttribute("message", "旧密码错误");
		}
		return "admin/editpwd";
	}

	// 管理员退出登录
	@RequestMapping("exit.action")
	public String exit() {
		this.getSession().removeAttribute("adminid");
		this.getSession().removeAttribute("adminname");
		this.getSession().removeAttribute("realname");
		return "admin/index";
	}

	// 准备添加数据
	@RequestMapping("createAdmin.action")
	public String createAdmin() {
		return "admin/addadmin";
	}

	// 添加数据
	@RequestMapping("addAdmin.action")
	public String addAdmin(Admin admin) {
		admin.setAddtime(VeDate.getStringDateShort());
		this.adminService.insertAdmin(admin);
		return "redirect:/admin/createAdmin.action";
	}

	// 通过主键删除数据
	@RequestMapping("deleteAdmin.action")
	public String deleteAdmin(String id) {
		this.adminService.deleteAdmin(id);
		return "redirect:/admin/getAllAdmin.action";
	}

	// 批量删除数据
	@RequestMapping("deleteAdminByIds.action")
	public String deleteAdminByIds() {
		String[] ids = this.getRequest().getParameterValues("adminid");
		for (String adminid : ids) {
			this.adminService.deleteAdmin(adminid);
		}
		return "redirect:/admin/getAllAdmin.action";
		return "admin/queryjiancai";
	}

	// 按主键查询数据
	@RequestMapping("getJiancaiById.action")
	public String getJiancaiById(String id) {
		Jiancai jiancai = this.jiancaiService.getJiancaiById(id);
		this.getRequest().setAttribute("jiancai", jiancai);
		List<Cate> cateList = this.cateService.getAllCate();
		this.getRequest().setAttribute("cateList", cateList);
		return "admin/editjiancai";
	}

	public JiancaiService getJiancaiService() {
		return jiancaiService;
	}

	public void setJiancaiService(JiancaiService jiancaiService) {
		this.jiancaiService = jiancaiService;
	}

}

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/peihuo", produces = "text/plain;charset=utf-8")
public class PeihuoAction extends BaseAction {
	// 注入Service 由于标签的存在 所以不需要getter setter
	@Autowired
	@Resource
	private PeihuoService peihuoService;
	@Autowired
	@Resource
	private CityService cityService;

	// 准备添加数据
	@RequestMapping("createPeihuo.action")
	public String createPeihuo() {
		List<City> cityList = this.cityService.getAllCity();
public String getUsersById(String id ) {
Users users = this.usersService.getUsersById(id);
this.getRequest().setAttribute("users", users);
return "admin/editusers";
}

public UsersService getUsersService() { return usersService; }

public void setUsersService(UsersService usersService) { this.usersService = usersService; }

}

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/cate", produces = "text/plain;charset=utf-8")
public class CateAction extends BaseAction {
	// 注入Service 由于标签的存在 所以不需要getter setter
	@Autowired
	@Resource
	private CateService cateService;

	// 准备添加数据
	@RequestMapping("createCate.action")
	public String createCate() {
		return "admin/addcate";
	}

	// 添加数据
	@RequestMapping("addCate.action")
	public String addCate(Cate cate) {
		cate.setAddtime(VeDate.getStringDateShort());
		this.cateService.insertCate(cate);
		return "redirect:/cate/createCate.action";
	}

	// 通过主键删除数据
	@RequestMapping("deleteCate.action")

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统 基于JavaWeb Servlet+JSP+MYSQL+Bootstrap 文章管理系统

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值