当前位置:   article > 正文

Java项目:springboot物业管理系统_return new jsonobject

return new jsonobject

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目为后管系统,分为管理员、业主两种角色;
管理员主要功能为:
社区核心业务处理:车位收费管理、物业收费管理、投诉信息管理、报修信息管理
基础信息管理:楼宇管理、房屋管理、业主管理、车位管理、抄表管理、登录信息管理、修改密码
基础类型管理:投诉类型管理、收费类型管理、报修类型管理
数据统计:报修统计

业主主要功能为:
车位费查询、物业费查询、我的投诉列表、我的报修列表、修改密码等;

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

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 8.0版本;

6.是否Maven项目:是;

技术栈

1. 后端:SpringBoot+Mybatis

2. 前端:HTML+CSS+JavaScript+LayUI

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,访问地址:http://localhost:8888
管理员账号/密码:admin/123456
业主账号/密码:kappy/123456

业主账号可通过管理员在业主管理模块进行添加,默认密码为123456

运行截图

 

 

 

 

 

 

代码相关

楼宇前端控制器

  1. @Api(tags = {""})
  2. @RestController
  3. @RequestMapping("/house")
  4. public class HouseController {
  5. private Logger log = LoggerFactory.getLogger(getClass());
  6. @Resource
  7. private IHouseService houseService;
  8. @RequestMapping("/houseAll")
  9. public JsonObject queryHouseAll(String numbers,
  10. @RequestParam(defaultValue = "1") Integer page,
  11. @RequestParam(defaultValue = "15") Integer limit){
  12. PageInfo<House> pageInfo=houseService.findHouseAll(page,limit,numbers);
  13. return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());
  14. }
  15. @RequestMapping("/queryAll")
  16. public List<House> queryAll(){
  17. PageInfo<House> pageInfo=houseService.findHouseAll(1,100,null);
  18. return pageInfo.getList();
  19. }
  20. @ApiOperation(value = "新增")
  21. @RequestMapping("/add")
  22. public R add(@RequestBody House house){
  23. if(house.getIntoDate()!=null){
  24. house.setStatus(1);
  25. }else{
  26. house.setStatus(0);
  27. }
  28. int num= houseService.add(house);
  29. if(num>0){
  30. return R.ok();
  31. }else{
  32. return R.fail("添加失败");
  33. }
  34. }
  35. @ApiOperation(value = "删除")
  36. @RequestMapping("/deleteByIds")
  37. public R delete(String ids){
  38. //z转成集合对象
  39. List<String> list= Arrays.asList(ids.split(","));
  40. for(String id:list){
  41. Long idLong=Long.parseLong(id);
  42. houseService.delete(idLong);
  43. }
  44. return R.ok();
  45. }
  46. @ApiOperation(value = "更新")
  47. @RequestMapping("/update")
  48. public R update(@RequestBody House house){
  49. if(house.getIntoDate()!=null){
  50. house.setStatus(1);
  51. }else{
  52. house.setStatus(0);
  53. }
  54. int num= houseService.updateData(house);
  55. if(num>0){
  56. return R.ok();
  57. }else{
  58. return R.fail("修改失败");
  59. }
  60. }
  61. @ApiOperation(value = "查询分页数据")
  62. @ApiImplicitParams({
  63. @ApiImplicitParam(name = "page", value = "页码"),
  64. @ApiImplicitParam(name = "pageCount", value = "每页条数")
  65. })
  66. @GetMapping()
  67. public IPage<House> findListByPage(@RequestParam Integer page,
  68. @RequestParam Integer pageCount){
  69. return houseService.findListByPage(page, pageCount);
  70. }
  71. @ApiOperation(value = "id查询")
  72. @GetMapping("{id}")
  73. public House findById(@PathVariable Long id){
  74. return houseService.findById(id);
  75. }
  76. }

通知前端控制器

  1. @Api(tags = {""})
  2. @RestController
  3. @RequestMapping("/notice")
  4. public class NoticeController {
  5. private Logger log = LoggerFactory.getLogger(getClass());
  6. @Resource
  7. private INoticeService noticeService;
  8. @ApiOperation(value = "新增")
  9. @PostMapping()
  10. public int add(@RequestBody Notice notice){
  11. return noticeService.add(notice);
  12. }
  13. @ApiOperation(value = "删除")
  14. @DeleteMapping("{id}")
  15. public int delete(@PathVariable("id") Long id){
  16. return noticeService.delete(id);
  17. }
  18. @ApiOperation(value = "更新")
  19. @PutMapping()
  20. public int update(@RequestBody Notice notice){
  21. return noticeService.updateData(notice);
  22. }
  23. @ApiOperation(value = "查询分页数据")
  24. @ApiImplicitParams({
  25. @ApiImplicitParam(name = "page", value = "页码"),
  26. @ApiImplicitParam(name = "pageCount", value = "每页条数")
  27. })
  28. @GetMapping()
  29. public IPage<Notice> findListByPage(@RequestParam Integer page,
  30. @RequestParam Integer pageCount){
  31. return noticeService.findListByPage(page, pageCount);
  32. }
  33. @ApiOperation(value = "id查询")
  34. @GetMapping("{id}")
  35. public Notice findById(@PathVariable Long id){
  36. return noticeService.findById(id);
  37. }
  38. }

 维修控制器

  1. @Api(tags = {""})
  2. @RestController
  3. @RequestMapping("/repair")
  4. public class RepairController {
  5. private Logger log = LoggerFactory.getLogger(getClass());
  6. @Resource
  7. private IRepairService repairService;
  8. @Resource
  9. private IRepairtypeService repairtypeService;
  10. @Resource
  11. private IOwnerService ownerService;
  12. @RequestMapping("/queryRepairAll")
  13. public JsonObject queryRepairAll(Repair repair,
  14. @RequestParam(defaultValue = "1") Integer page,
  15. @RequestParam(defaultValue = "15") Integer limit){
  16. PageInfo<Repair> pageInfo=repairService.findRepairAll(page,limit,repair);
  17. return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());
  18. }
  19. @RequestMapping("/queryRepairAll2")
  20. public JsonObject queryRepairAll2(Repair repair, HttpServletRequest request,
  21. @RequestParam(defaultValue = "1") Integer page,
  22. @RequestParam(defaultValue = "15") Integer limit){
  23. //获取当前得登录用户
  24. Userinfo userinfo= (Userinfo) request.getSession().getAttribute("user");
  25. String username=userinfo.getUsername();
  26. //根据username获取登录账号得业主id
  27. Owner owner=ownerService.queryOwnerByName(username);
  28. repair.setOwnerId(owner.getId());
  29. PageInfo<Repair> pageInfo=repairService.findRepairAll(page,limit,repair);
  30. return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());
  31. }
  32. @RequestMapping("/queryAll")
  33. public List<Repairtype> queryAll(){
  34. return repairtypeService.findList();
  35. }
  36. @RequestMapping("/deleteByIds")
  37. public R deleteByIds(String ids){
  38. List<String> list= Arrays.asList(ids.split(","));
  39. for(String id:list){
  40. repairService.delete(Long.parseLong(id));
  41. }
  42. return R.ok();
  43. }
  44. @ApiOperation(value = "新增")
  45. @RequestMapping("/add")
  46. public R add(@RequestBody Repair repair, HttpServletRequest request)
  47. {
  48. //获取当前得登录用户
  49. Userinfo userinfo= (Userinfo) request.getSession().getAttribute("user");
  50. //String username=userinfo.getUsername();
  51. //System.out.println( repair.getRemarks());
  52. //根据username获取登录账号得业主id
  53. Owner owner=ownerService.queryOwnerById(userinfo.getId());
  54. //Repairtype repairtype=repairtypeService.findById(Long.valueOf(repair.getComId()));
  55. Repair repair1=new Repair();
  56. repair1.setRemarks(repair.getRemarks());
  57. repair1.setClr(repair.getClr());
  58. repair1.setOwnerId(userinfo.getId());
  59. repair1.setStatus(Integer.valueOf(0));
  60. repair1.setComDate(new Date());
  61. repair1.setComId(repair.getComId());
  62. //repair1.setOwner(owner);
  63. //repair1.setType(repairtype);
  64. int num=repairService.add(repair1);
  65. if(num>0){
  66. return R.ok();
  67. }
  68. return R.fail("失败啦");
  69. }
  70. @ApiOperation(value = "更新")
  71. @RequestMapping("/update")
  72. public R update(Integer id){
  73. Repair repair=new Repair();
  74. repair.setId(id);
  75. repair.setStatus(1);
  76. repair.setHandleDate(new Date());
  77. int num=repairService.updateData(repair);
  78. return R.ok();
  79. }
  80. /**
  81. * 统计分析
  82. */
  83. @RequestMapping("/queryTongJi")
  84. public List<Tongji> queryTongji(){
  85. return repairService.queryTongji();
  86. }
  87. @ApiOperation(value = "删除")
  88. @RequestMapping("/deleteId")
  89. public R delete(String ids){
  90. List<String> list= Arrays.asList(ids.split(","));
  91. //遍历遍历进行删除
  92. for(String id:list){
  93. repairtypeService.delete(Long.parseLong(id));
  94. }
  95. return R.ok();
  96. }
  97. @ApiOperation(value = "更新")
  98. @RequestMapping("/update1")
  99. public R update1(@RequestBody Repair repair){
  100. //System.out.println(repair.getComId());
  101. int num=repairService .updateData(repair);
  102. if(num>0){
  103. return R.ok();
  104. }else{
  105. return R.fail("修改失败");
  106. }
  107. }
  108. }

如果也想学习本系统,下面领取。回复:077springboot

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

闽ICP备14008679号