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






基于javaweb的SpringBoot体育器材管理系统(java+springboot+bootstrap+html+thymeleaf+mysql+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
|
@RestController @RequestMapping("br") public class BorrowController extends BaseController{ @Autowired ManagerServiceImpl service; @Autowired EquServiceImpl equService; @Autowired EquMapper mapper; @Autowired ManagerMapper managerMapper;
@RequestMapping("checkborrow") public JsonResult<Void> checkBorrow(String username,String num,HttpSession session){ session.setAttribute("empname",username); session.setAttribute("empnum",num); service.check(username,num); return new JsonResult<>(OK); }
@RequestMapping("checkreturn") public JsonResult<Void> checkReturn(String username,String num,HttpSession session){ session.setAttribute("empname",username); session.setAttribute("empnum",num); service.check(username,num); return new JsonResult<>(OK); } @RequestMapping("borrowready") public JsonResult<String> borrowusername(HttpSession session){ String username=session.getAttribute("empname").toString(); return new JsonResult<>(OK,username);
} @RequestMapping("returnready") public JsonResult<List<Borrow>> returnusername(HttpSession session,Integer page){ String username=session.getAttribute("empname").toString();
|
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
| System.out.println(id); emp=managerMapper.findEmpById(id); System.out.println(emp);
} return new JsonResult<>(OK); } @RequestMapping("/getEquNotes") public JsonResult<Equipment> getEquNote(){ System.out.println(equipment); return new JsonResult<>(OK,equipment); } @RequestMapping("/getEmpNotes") public JsonResult<Emp> getEmpNotes(){ System.out.println(emp); return new JsonResult<>(OK,emp); }
@RequestMapping("/addEqu") public JsonResult<String> addEqu(Equipment equipment){ System.out.println(equipment); if (service.addEqu(equipment)!=1){ return new JsonResult<>("添加失败,请重试"); } return new JsonResult<>(OK); } @RequestMapping("/addEmp") public JsonResult<String> addEmp(Emp emp){ System.out.println(emp); if (service.addEmp(emp)!=1){ return new JsonResult<>("添加失败,请重试"); } return new JsonResult<>(OK); }
private static final List<String> AVATAR_TYPES = new ArrayList<>();
static { AVATAR_TYPES.add("application/vnd.ms-excel"); AVATAR_TYPES.add("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); }
@PostMapping("/uploadequ") public JsonResult<String> uploadEqu( @RequestParam("file") MultipartFile file, HttpSession session) {
|
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
| public JsonResult<String> sendVerificationCode(String num){ System.out.println(num); realKey= emailSend.KeyCreated(); if (emailSend.RegisterManager(realKey,managerService.findRegPwd(num))==1){ return new JsonResult<>(OK); } return new JsonResult<>(1000,"发送失败,请重试"); }
@RequestMapping("/register") public JsonResult<String> register(Manager manager,String key){ System.out.println("key"+key); System.out.println("realkey"+realKey); if (key.equals(realKey)){ System.out.println("=="); managerService.reg(manager); System.out.println("success"); return new JsonResult<>(OK); }else { System.out.println("false"); return new JsonResult<>(1111); } }
@RequestMapping("/loginnum") public JsonResult<String> loginnum( HttpSession session){ String managernum=getNumFromSession(session); System.err.println(managernum); return new JsonResult<>(OK,managernum); }
private String VerificationCode=""; @RequestMapping("/sendFindPwd") public JsonResult<String> sendFindPwd(String num){ System.out.println(num); VerificationCode=emailSend.KeyCreated(); System.out.println(VerificationCode); if (emailSend.RegisterManager(VerificationCode,managerService.findPwd(num))==1){ return new JsonResult<>(OK); } return new JsonResult<>(1000,"发送失败,请重试"); }
|
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
| }
String originalFilename = file.getOriginalFilename(); System.err.println("\toriginalFilename=" + originalFilename);
String parent = session .getServletContext().getRealPath("upload"); System.err.println("\tupload path=" + parent); File dir = new File(parent); if (!dir.exists()) { dir.mkdirs(); }
String filename = "" + System.currentTimeMillis() + System.nanoTime(); String suffix = ""; int beginIndex = originalFilename .lastIndexOf("."); if (beginIndex >= 1) { suffix = originalFilename .substring(beginIndex); } String child = filename + suffix;
File dest = new File(parent, child); try { file.transferTo(dest); } catch (IllegalStateException e) { System.out.println( "上传失败!您的文件的状态异常!"); } catch (IOException e) { System.out.println( "上传失败!读写文件时出现错误,请重新上传!"); }
String avatar = File.separator + child; System.err.println("\tavatar path=" + avatar); System.out.println(); System.out.println(managerService.ExcelRead(parent,avatar)); return new JsonResult<>(OK); } } package com.zm.se.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
| return new JsonResult<>(OK); } @RequestMapping("/updateEmpById") public JsonResult<Void> updateEmp(Emp emp){ service.updateEmp(emp); return new JsonResult<>(OK); } @RequestMapping("/updateEquById") public JsonResult<Void> updateEqu(Equipment equipment){ service.updateEqu(equipment); return new JsonResult<>(OK); }
@RequestMapping("/showlist") public JsonResult<List<Equipment>> showlist(Integer page){ List<Equipment> list=mapper.orderequlist(page); for (Equipment map : list) { System.err.println(map); } return new JsonResult<>(OK,list); } @RequestMapping("/showprice") public JsonResult<List<Equipment>> showprice(Integer page){ System.err.println("showprice执行"); List<Equipment> list=mapper.pricelist(page); for (Equipment map : list) { System.err.println(map); } System.err.println("showprice执行完毕"); return new JsonResult<>(OK,list); }
@RequestMapping("/showsup") public JsonResult<List<Equipment>> showsup(Integer page){ List<Equipment> list=mapper.suplist(page); for (Equipment map : list) { System.err.println(map); } return new JsonResult<>(OK,list); } @RequestMapping("/showEquHistory")
|
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("/showsup") public JsonResult<List<Equipment>> showsup(Integer page){ List<Equipment> list=mapper.suplist(page); for (Equipment map : list) { System.err.println(map); } return new JsonResult<>(OK,list); } @RequestMapping("/showEquHistory") public JsonResult<List<Equipment>> showEquHistory(Integer page){ List<Equipment> list=mapper.equhistory(page); for (Equipment map : list) { System.err.println(map); } return new JsonResult<>(OK,list); }
Equipment equipment=new Equipment(); Emp emp=new Emp();
@RequestMapping("/postNotes") public JsonResult<Void> postNote(Integer id, String key){ System.out.println(id+key); if (key.equals("equ")){ System.out.println(id); equipment=mapper.findEquById(id); System.out.println(equipment); } if (key.equals("emp")){ System.out.println(id); emp=managerMapper.findEmpById(id); System.out.println(emp);
} return new JsonResult<>(OK); } @RequestMapping("/getEquNotes") public JsonResult<Equipment> getEquNote(){ System.out.println(equipment); return new JsonResult<>(OK,equipment); } @RequestMapping("/getEmpNotes")
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=041422272105200ad
https://javayms.pages.dev?id=041422272105200ad