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






基于javaweb的SSM+Maven校园物品租赁管理系统(java+ssm+jsp+layui+maven+mysql)
一、项目简述 环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
——————————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
|
@RequestMapping("/getMyPaidBack") public String getMyPaidBack(HttpSession httpSession,Model model,QueryVo vo, @RequestParam(required = false,defaultValue="1") Integer page, @RequestParam(required = false,defaultValue="8") Integer pageSize){ User user = (User) httpSession.getAttribute("user"); vo.setUserId(user.getId()); PageHelper.startPage(page, pageSize); List<QueryPaid> paids = paidService.getPaidBackListByQueryVo(vo); PageInfo<QueryPaid> p = new PageInfo<>(paids); Integer sumBackPrice = paidService.getAllBackPriceByUserId(vo,user.getId()); model.addAttribute("paids",paids); model.addAttribute("p",p); model.addAttribute("sum",sumBackPrice); model.addAttribute("vo",vo); return "user/mypaidback"; }
@RequestMapping("/deletePaidBack") public String deletePaidBackById(Integer id){ paidService.deletePaidBackById(id); return"redirect:getMyPaidBack.action"; }
@RequestMapping("/incomeByUser") public String incomeByUserId(QueryVo vo,Model model,HttpSession httpSession, @RequestParam(required = false,defaultValue = "1") Integer page, @RequestParam(required = false,defaultValue = "8") Integer pageSize){ User user = (User)httpSession.getAttribute("user"); vo.setUserId(user.getId()); PageHelper.startPage(page, pageSize); List<QueryPaid> paids = paidService.getIncomeByUserId(vo); PageInfo<QueryPaid> p = new PageInfo<>(paids); Integer totalIncome = paidService.getTotalIncome(vo,user.getId()); model.addAttribute("totalIncome",totalIncome); model.addAttribute("paids",paids); model.addAttribute("p",p);
|
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
| model.addAttribute("info", "checkoutsuccess"); return "redirect:/hetong/findAllHetong.action"; }
@RequestMapping("/deleteHetongByUser") public String deleteHetongByUser(String itemId, Model model) { Hetong hetong = hetongService.getHetongByItemId(Integer.parseInt(itemId)); Checkout checkout = new Checkout(); checkout.setItemId(itemId); checkout.setItemName(hetong.getItemName()); checkout.setStatus("已退租"); checkout.setUserId(Integer.parseInt(hetong.getZuKeId())); checkout.setMasterId(Integer.parseInt(hetong.getChuZuId())); checkout.setItemNumber(hetong.getItemNumber()); checkoutService.insertcheckout(checkout); Item item = new Item(); item = itemMapper.findItemId(hetong.getItemId()); itemMapper.deleteItem(Integer.parseInt(itemId)); item.setStatus("未租赁"); item.setItemId(0); itemMapper.insertItem(item); hetongService.deletehetong(itemId); model.addAttribute("error", "checkoutsuccess"); return "redirect:/hetong/findAllHetongByZuke.action"; }
@RequestMapping("/zukeseehetong") public String zukeseehetong(String itemId, Model model) { Hetong hetong = hetongService.findhetong(itemId);
|
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
| @Controller @RequestMapping("/schedule") public class ScheduleController { @Autowired private ScheduleService scheduleService;
@RequestMapping("/selectAll") public String selectAll(Model model, @RequestParam(required = false, defaultValue = "1") Integer page, @RequestParam(required = false, defaultValue = "8") Integer pageSize) { PageHelper.startPage(page, pageSize); List<Schedule> schedule = scheduleService.selectAll(); PageInfo<Schedule> p = new PageInfo<Schedule>(schedule); model.addAttribute("schedule", schedule); model.addAttribute("p", p); model.addAttribute("mainPage", "schedule.jsp"); return "admin/main1"; }
@RequestMapping("/deleteschedule") public String deleteschedule(Integer id) { scheduleService.deleteschedule(id); return "redirect:selectAll.action"; }
@RequestMapping("/insertschedule") public String insertschedule(Schedule schedule, Model model) { scheduleService.insertschedule(schedule);
return "redirect:selectAll.action";
}
@RequestMapping("/updateschedule") public String updateschedule(Schedule schedule, Model model) { scheduleService.updateschedule(schedule); model.addAttribute("error", "更新成功"); model.addAttribute("schedule", schedule); model.addAttribute("mainPage", "updateschedule.jsp"); return "admin/main1";
}
@RequestMapping("/toinsert") public String toinsert(Model model) { model.addAttribute("mainPage", "addschedule.jsp");
return "admin/main1";
|
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
| return "admin/updateAdminInfo";
}
@RequestMapping("/myDetails") public String getUserDetails(HttpSession httpSession , Model model){ User user = (User)httpSession.getAttribute("user"); Integer userId = user.getId(); Userlist userDetails = userlistService.findhasuserlist(userId); model.addAttribute("userDetails",userDetails); return"user/mydetails"; }
@RequestMapping("/adminDetails") public String getAdminDetails(HttpSession httpSession , Model model){ User user = (User)httpSession.getAttribute("user"); Integer userId = user.getId(); Userlist userDetails = userlistService.findhasuserlist(userId); model.addAttribute("userDetails",userDetails); return"admin/mydetails"; }
@RequestMapping("/checkuserlist") public String checkuserlist(Model model, Userlist userlist, HttpSession httpSession) throws Exception {
|
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
| @RequestMapping("/logincheck") public String login(User user, Model model, HttpSession httpSession) throws Exception {
User user1 = userService.login(user);
if (user1 != null) { httpSession.setAttribute("user", user1); if (user1.getType().equals("user")) { return "user/main"; } else { return "admin/main1"; } } else { String error = "error"; model.addAttribute("error", error); return "login"; } }
@RequestMapping("/toindex") public String toindex(Model model) throws Exception {
return "admin/index"; }
@RequestMapping("updatePwd") public String updatePwd(Model model,String OriginalPwd,String NewPwd, String ConfirmPwd,HttpSession httpSession){ if (!NewPwd.equals(ConfirmPwd)) { model.addAttribute("info", "新密码与确认密码不一致"); return "user/updatePwd"; } User user = (User)httpSession.getAttribute("user"); Integer id = user.getId();
|
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
| @Controller @RequestMapping("/hetong") public class HetongController { @Autowired private HetongService hetongService; @Autowired private ItemService itemService; @Autowired private ApplyService applyService; @Autowired private CheckoutService checkoutService; @Autowired private UserlistService userlistService; @Autowired private ItemMapper itemMapper;
@RequestMapping("/inserthetong") public String insertHetong(Model model, Integer itemId,Hetong hetong, HttpSession httpSession) { hetong = hetongService.getApplyByItemId(itemId); Item item = itemService.findItemId(hetong.getItemId()); int masterId = item.getMasterId(); Userlist master = userlistService.findhasuserlist(masterId); hetong.setChuZuIdcard(master.getIdcard()); hetong.setZuKeId(hetong.getZuKeId()); hetong.setChuZuId(item.getMasterId().toString()); hetongService.inserthetong(hetong); Hetong hetong1 = hetongService.findhetong(hetong.getItemId());
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=031422292105200ef
https://javayms.pages.dev?id=031422292105200ef