——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明









基于javaweb的SpringBoot实验室管理系统(java+springboot+vue+mysql+maven)
/springbootdtjr3
管理员
admin 123456
用户
用户1 123456
用户2 123456
用户3 123456
前台:
http://localhost:8080/springbootdtjr3/front/index.html
后台:
http://localhost:8080/springbootdtjr3/admin/dist/index.html
端口需要为:8080
管理端(vue分离端)使用:
1 npm run build打包
2 将打包的dist内容复制到admin目录下即可(目前已经复制过去了)
——————————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 49 50 51
|
@RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ chatService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); }
@RequestMapping("/remind/{columnName}/{type}") public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) { map.put("column", columnName); map.put("type", type); if(type.equals("2")) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar c = Calendar.getInstance(); Date remindStartDate = null; Date remindEndDate = null; if(map.get("remindstart")!=null) { Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart); remindStartDate = c.getTime(); map.put("remindstart", sdf.format(remindStartDate)); } if(map.get("remindend")!=null) { Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindEnd); remindEndDate = c.getTime(); map.put("remindend", sdf.format(remindEndDate)); } } Wrapper<ChatEntity> wrapper = new EntityWrapper<ChatEntity>(); if(map.get("remindstart")!=null) { wrapper.ge(columnName, map.get("remindstart")); } if(map.get("remindend")!=null) { wrapper.le(columnName, map.get("remindend")); }
int count = chatService.selectCount(wrapper);
|
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
|
@RequestMapping("/save") public R save(@RequestBody XiaohaopinEntity xiaohaopin, HttpServletRequest request){ xiaohaopin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); xiaohaopinService.insert(xiaohaopin); return R.ok(); }
@RequestMapping("/add") public R add(@RequestBody XiaohaopinEntity xiaohaopin, HttpServletRequest request){ xiaohaopin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); xiaohaopinService.insert(xiaohaopin); return R.ok(); }
@RequestMapping("/update") public R update(@RequestBody XiaohaopinEntity xiaohaopin, HttpServletRequest request){ xiaohaopinService.updateById(xiaohaopin); return R.ok(); }
@RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ xiaohaopinService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); }
@RequestMapping("/remind/{columnName}/{type}") public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) { map.put("column", columnName);
|
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
| if(configEntity==null) { configEntity = new ConfigEntity(); configEntity.setName("faceFile"); configEntity.setValue(fileName); } else { configEntity.setValue(fileName); } configService.insertOrUpdate(configEntity); } return R.ok().put("file", fileName); }
@IgnoreAuth @RequestMapping("/download") public ResponseEntity<byte[]> download(@RequestParam String fileName) { try { File path = new File(ResourceUtils.getURL("classpath:static").getPath()); if(!path.exists()) { path = new File(""); } File upload = new File(path.getAbsolutePath(),"/upload/"); if(!upload.exists()) { upload.mkdirs(); } File file = new File(upload.getAbsolutePath()+"/"+fileName); if(file.exists()){
HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment", fileName); return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED); } } catch (IOException e) { e.printStackTrace(); } return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR); }
|
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
| YonghuView yonghuView = yonghuService.selectView(ew); return R.ok("查询用户成功").put("data", yonghuView); }
@RequestMapping("/info/{id}") public R info(@PathVariable("id") String id){ YonghuEntity yonghu = yonghuService.selectById(id); return R.ok().put("data", yonghu); }
@RequestMapping("/detail/{id}") public R detail(@PathVariable("id") String id){ YonghuEntity yonghu = yonghuService.selectById(id); return R.ok().put("data", yonghu); }
@RequestMapping("/save") public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){ yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming())); if(user!=null) { return R.error("用户已存在"); } yonghu.setId(new Date().getTime()); yonghuService.insert(yonghu); return R.ok(); }
@RequestMapping("/add") public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
|
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
| } File file = new File(upload.getAbsolutePath()+"/"+fileName); if(file.exists()){
HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment", fileName); return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED); } } catch (IOException e) { e.printStackTrace(); } return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR); } }
@RequestMapping("config") @RestController public class ConfigController{ @Autowired private ConfigService configService;
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=341523290309201dm
https://javayms.pages.dev?id=341523290309201dm