基于SpringBoot物业疫情管理系统源码和论文

随着2020年新冠疫情的爆发,越来越多的物业对于小区的管理更加严格。传统的社区管理信息系统存在着许多的管理弊端。一方面,传统的社区管理信息系统未能考虑到疫情防控的要求,没有每日要求小区的业主进行疫情打卡并实时监测社区居民的身体健康情况。另一方面,传统的小区管理系统也未能有效地统计分析用户提交的报修信息,从而降低社区管理的费用。

针对以上情况,本文设计并开发了一套全新的小区综合管理系统,可望解决上述存在的痛点,从而提升小区的管理效率和居民幸福感。本系统包含了疫情打卡、报修统计、停车位管理、物业缴费处理等功能。在技术上,本系统采用目前主流的后台开发框架SpringBoot (SpringMVC + Spring + MyBatis),前端开发框架使用Layui、jQuery。

【631】基于SpringBoot物业疫情管理系统源码和论文

关键词 :疫情; 小区管理; SpringBoot; Layui

ABSTRACT

 With the outbreak of the Covid-19 in 2020, more and more properties have stricter management of the community. The traditional community management system has many management drawbacks. On the one hand, the traditional community management system fails to take into account the requirements for Covid-19 prevention and control, and does not require the owners of the community to check in the contagion on a daily basis and monitor the health of the community residents in real time. On the other hand, the traditional community management system also fails to effectively statistically analyze the repair information submitted by users, thereby reducing the cost of community management. In view of the above situation, this paper designs and develops a new comprehensive management system for the community, which is expected to solve the above-mentioned pain points, thereby improving the management efficiency of the community and the happiness of residents. This system includes functions such as check-in for Covid-19 , repair report statistics, parking space management, and property payment processing. Technically, this system uses the current mainstream back-end development framework Springboot (SpringMVC + Spring + MyBatis), and the front-end development framework uses Layui and jQuery.

Keywords Contagion;Community management;SpringBoot;Layui

package com.yx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.PageInfo;
import com.yx.model.Clockinnew;
import com.yx.model.Owner;
import com.yx.model.Userinfo;
import com.yx.service.IClockInNewService;
import com.yx.service.IOwnerService;
import com.yx.util.JsonObject;
import com.yx.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author     
 * @Descripton 疫情打卡控制器
 */
@Api(tags = {""})
@RestController
@RequestMapping("/clockinnew")
public class ClockInNewController {

    private Logger log = LoggerFactory.getLogger(getClass());

    @Resource
    private IClockInNewService clockinnewService;

    @Resource
    private IOwnerService ownerService;


    @RequestMapping("/queryClockInAll")
    public JsonObject queryClockInAll(Clockinnew clockinnew,String name,
                                      @RequestParam(defaultValue = "1") Integer pageNum,
                                      @RequestParam(defaultValue = "15") Integer pageSize
                                      ){
        if(name!=null){
            Owner owner = new Owner();
            owner.setUsername(name);
            clockinnew.setOwner(owner);
        }
        PageInfo<Clockinnew> pageInfo= clockinnewService.queryClockInAll(pageNum,pageSize,clockinnew);
        return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());
    }

    @RequestMapping("/queryClockInAll2")
    public JsonObject queryClockInAll2(Clockinnew clockinnew, HttpServletRequest request,
                                       @RequestParam(defaultValue = "1") Integer pageNum,
                                       @RequestParam(defaultValue = "15") Integer pageSize
                                      ){
        //获取当前得登录用户
        Userinfo userinfo= (Userinfo) request.getSession().getAttribute("user");
        String username=userinfo.getUsername();

        //根据username获取登录账号得业主id
        Owner owner=ownerService.queryOwnerByName(username);
        clockinnew.setOwnerId(owner.getId());
        PageInfo<Clockinnew> pageInfo= clockinnewService.queryClockInAll(pageNum,pageSize,clockinnew);
        return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());
    }

    @RequestMapping("/queryOwner")
    public  List<Owner> queryOwner(HttpServletRequest request,Clockinnew clockinnew){
        //获取当前得登录用户
        Userinfo userinfo= (Userinfo) request.getSession().getAttribute("user");
        String username=userinfo.getUsername();

        //根据username获取登录账号得业主id
        Owner owner=ownerService.queryOwnerByName(username);
        List<Owner> list = new ArrayList<>();
        list.add(owner);
        return list;
    }

    @ApiOperation(value = "新增")
    @PostMapping("/add")
    public R add(@RequestBody Clockinnew clockinnew,HttpServletRequest request){

        /**
         * 打卡前先判断这个用户在当天是否已经打卡,若已打卡提示您已经打卡
         * 通过ownerId,查询最近一条数据日期是否是今天,判断是否已经打卡,若填的日期不是今天,那么提示日期错误
         * queryCountByOwnIdAndTime(),返回查找到记录的条数,条数大于0,表示已经打卡,反之未打卡
         *
         * 若未打卡则,添加打卡信息
         * 通过username查找对应的owner,可获取到其id
         */
        //获取当前得登录用户
        Userinfo userinfo= (Userinfo) request.getSession().getAttribute("user");
        String username=userinfo.getUsername();

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
        String todayDate = df.format(new Date());//今天的日期
        //System.out.println(todayDate);

        Owner owner = ownerService.queryOwnerByName(username);
        Integer ownerId = owner.getId();

        Date timeFlag = clockinnewService.queryCountByOwnId(ownerId);//数据库查到业主的最近一次打卡日期
        String timeFlag1="";
        if (timeFlag!=null){
            timeFlag1=df.format(timeFlag);//查到的最近打卡日期
        }

        if (timeFlag1.equals(todayDate)){//若今天日期等于数据库中已经查到业主的时间,则说明已经打卡
                return R.fail(400,"今日已打卡,请勿重复打卡");
        }
        //不相等,证明数据库还没有这个业主今日的打卡记录,正常打卡
        clockinnew.setOwnerId(owner.getId());

        //若为疑似病例或者确诊那么提示请填写备注
        if (clockinnew.getType1()==1 || clockinnew.getType2()==1){
            if (clockinnew.getRemarks()==null || clockinnew.getRemarks()==""){
                return R.fail(400,"请填写备注并详细说明");
            }
        }
        int num = clockinnewService.add(clockinnew);
        return R.ok();

    }

    @ApiOperation(value = "删除")
    @RequestMapping("/deleteByIds")
    public R delete(String ids){
        List<String> list= Arrays.asList(ids.split(","));
        for(String id:list){
            Long idLong=new Long(id);
            clockinnewService.delete(idLong);
        }
        return R.ok();
    }

    @ApiOperation(value = "更新")
    @PutMapping()
    public int update(@RequestBody Clockinnew clockinnew){
        return clockinnewService.updateData(clockinnew);
    }

    @ApiOperation(value = "查询分页数据")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "page", value = "页码"),
        @ApiImplicitParam(name = "pageCount", value = "每页条数")
    })
    @GetMapping()
    public IPage<Clockinnew> findListByPage(@RequestParam Integer page,
                                            @RequestParam Integer pageCount){
        return clockinnewService.findListByPage(page, pageCount);
    }

    @ApiOperation(value = "id查询")
    @GetMapping("{id}")
    public Clockinnew findById(@PathVariable Long id){
        return clockinnewService.findById(id);
    }

}

 

package com.yx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.PageInfo;
import com.yx.model.Building;
import com.yx.model.Clockin;
import com.yx.model.House;
import com.yx.model.Owner;
import com.yx.service.IBuildingService;
import com.yx.service.IClockinService;
import com.yx.service.IHouseService;
import com.yx.service.IOwnerService;
import com.yx.util.JsonObject;
import com.yx.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author
 * @Description 打卡旧控制
 */
@Api(tags = {""})
@RestController
@RequestMapping("/clockin")
public class ClockinController {

    private Logger log = LoggerFactory.getLogger(getClass());

    @Resource
    private IClockinService clockinService;

    @Resource
    private IOwnerService ownerService;

    @Resource
    private IBuildingService buildingService;

    @Resource
    private IHouseService houseService;

    @RequestMapping("/queryClockInAll")
    public JsonObject queryClockInAll(@RequestParam(defaultValue = "1") Integer pageNum,
                                        @RequestParam(defaultValue = "15") Integer pageSize,
                                        Clockin clockin){
        PageInfo<Clockin> pageInfo= clockinService.queryClockInAll(pageNum,pageSize,clockin);
        return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());

    }

    @ApiOperation(value = "新增")
    @RequestMapping("/clockInAdd")
    public R add(String username){

        /**
         * 打卡前先判断这个用户在当天是否已经打卡,若已打卡提示您已经打卡
         * 通过两个参数ownerId+clockTime判断是否已经打卡,就是业主名+打卡时间
         * queryCountByOwnIdAndTime(),返回查找到记录的条数,条数大于0,表示已经打卡,反之未打卡
         *
         * 若未打卡则,添加打卡信息
         * 1、通过username查找对应的owner,可获取到其id
         * 2、通过owner中house_id,查找house
         * 3、通过house得到building_id
         * 4、new Date作为打卡时间
         */
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
        String todayDate = df.format(new Date());//今天的日期
        System.out.println(todayDate);

        Owner owner = ownerService.queryOwnerByName(username);
        Integer ownerId = owner.getId();
        Date timeFlag = clockinService.queryCountByOwnIdAndTime(ownerId);//数据库查到业主的日期
        String timeFlag1=df.format(timeFlag);

        if (timeFlag1.equals(todayDate)){//若今天日期等于数据库中已经查到业主的时间,则说明已经打卡
            return R.fail(400,"今日已打卡,请勿重复打卡");
        }
        //不相等,证明数据库还没有这个业主今日的打卡记录,正常打卡
        Integer houId = owner.getHouseId();
        House house = houseService.queryHouseById(houId);

        Integer buildId = house.getBuildingId();
        //Building building = buildingService.queryBuildById(buildId);

        Clockin clockin = new Clockin();
        clockin.setClockInTime(new Date());
        clockin.setOwnerId(ownerId);
        clockin.setHouseId(houId);
        clockin.setBuildingId(buildId);
        System.out.println(clockin);
        int num = clockinService.add(clockin);
        return R.ok();
    }

    @ApiOperation(value = "删除")
    @RequestMapping("/deleteByIds")
    public R delete(String ids){
        List<String> list= Arrays.asList(ids.split(","));
        for(String id:list){
            Long idLong=new Long(id);
            clockinService.delete(idLong);
        }
        return R.ok();
    }

    @ApiOperation(value = "更新")
    @PutMapping()
    public int update(@RequestBody Clockin clockin){
        return clockinService.updateData(clockin);
    }

    @ApiOperation(value = "查询分页数据")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "page", value = "页码"),
        @ApiImplicitParam(name = "pageCount", value = "每页条数")
    })
    @GetMapping()
    public IPage<Clockin> findListByPage(@RequestParam Integer page,
                                         @RequestParam Integer pageCount){
        return clockinService.findListByPage(page, pageCount);
    }

    @ApiOperation(value = "id查询")
    @GetMapping("{id}")
    public Clockin findById(@PathVariable Long id){
        return clockinService.findById(id);
    }

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值