天天看點

基于微信小程式圖書館管理系統

開發工具:IDEA、微信小程式

伺服器:Tomcat9.0, jdk1.8

項目建構:maven

資料庫:mysql5.7

前端技術:vue、uniapp

服務端技術:springboot+mybatis-plus

本系統分微信小程式和管理背景兩部分,項目采用前後端分離

系統主要分為兩個角色:管理者和普通使用者。

1.普通使用者(小程式):登入、注冊、首頁、搜尋圖書、借閱、收藏、圖書分類、座位查詢與預訂、我的收藏、借閱查詢、登出等功能。

2.管理者(背景):登入、首頁、使用者管理、圖書分類、借閱管理、圖書管理、閱覽室管理、座位管理、收藏管理、系統管理(管理者管理、角色管理、菜單管理、系統日志)、登出、修改密碼等功能的管理

文檔截圖:

基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統

微信小程式截圖:

基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統

背景截圖:

基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
基于微信小程式圖書館管理系統
package io.renren.modules.renren.controller;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.alibaba.druid.sql.visitor.functions.Now;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.modules.renren.entity.BookManagerEntity;
import io.renren.modules.renren.service.BookManagerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.renren.entity.BookBorrowEntity;
import io.renren.modules.renren.service.BookBorrowService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;

import javax.annotation.Resource;

@RestController
@RequestMapping("renren/bookborrow")
public class BookBorrowController {
    @Autowired
    private BookBorrowService bookBorrowService;

    @Resource
    private BookManagerService bookManagerService;
    /**
     * 清單
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = bookBorrowService.queryPage(params);

        return R.ok().put("page", page);
    }

    @RequestMapping("/list2")
    public R list2(Integer userId,Integer bookState,@RequestParam Map<String, Object> params){
        PageUtils page = bookBorrowService.queryPage2(userId,bookState,params);

        return R.ok().put("page", page);
    }


    /**
     * 資訊
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
        BookBorrowEntity bookBorrow = bookBorrowService.getById(id);

        return R.ok().put("bookBorrow", bookBorrow);
    }

    /**
     * 儲存
     */
    @RequestMapping("/save")
    public R save(@RequestBody BookBorrowEntity bookBorrow){

        BookBorrowEntity book=bookBorrowService.getById(bookBorrow.getBookId());

        List<BookBorrowEntity>  list=bookBorrowService.list(new QueryWrapper<BookBorrowEntity>().eq("book_id",bookBorrow.getBookId()));
        if (list.size()>0){
            if (list.get(0).getBookState()==1){
                return R.error();
            }
        }

       Date a= new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 3);
        SimpleDateFormat dateFormat2=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String aaa=dateFormat2.format(a);
        bookBorrow.setBookReamrk(aaa);

        bookBorrowService.save(bookBorrow);
        BookManagerEntity bk=new BookManagerEntity();
        bk.setBookState(1);
        bookManagerService.update(bk,new QueryWrapper<BookManagerEntity>().eq("id",bookBorrow.getBookId()));

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody BookBorrowEntity bookBorrow){

       BookManagerEntity bk=new BookManagerEntity();
        bk.setBookState(0);
            bookManagerService.update(bk,new QueryWrapper<BookManagerEntity>().eq("id",bookBorrow.getBookId()));
        bookBorrow.setUpdateDate(new Date());
        bookBorrow.setBookState(0);//歸還
        bookBorrowService.updateById(bookBorrow);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        bookBorrowService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
           

package io.renren.modules.renren.controller;

import java.util.Arrays;

import java.util.Date;

import java.util.List;

import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import org.apache.shiro.authz.annotation.RequiresPermissions;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.PathVariable;

import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.renren.entity.BookSeatEntity;

import io.renren.modules.renren.service.BookSeatService;

import io.renren.common.utils.PageUtils;

import io.renren.common.utils.R;

@RestController

@RequestMapping("renren/bookseat")

public class BookSeatController {

@Autowired

private BookSeatService bookSeatService;

@RequestMapping("/list")

public R list(@RequestParam Map<String, Object> params){

PageUtils page = bookSeatService.queryPage(params);

return R.ok().put("page", page);

}

@RequestMapping("/list2")

public R list2(@RequestParam Map<String, Object> params){

PageUtils page = bookSeatService.queryPage2(params);

return R.ok().put("page", page);

}

@RequestMapping("/info/{id}")

public R info(@PathVariable("id") Integer id){

BookSeatEntity bookSeat = bookSeatService.getById(id);

return R.ok().put("bookSeat", bookSeat);

}

@RequestMapping("/save")

public R save(@RequestBody BookSeatEntity bookSeat){

bookSeat.setSeatState(0);

bookSeatService.save(bookSeat);

return R.ok();

}

@RequestMapping("/update")

public R update(@RequestBody BookSeatEntity bookSeat){

bookSeat.setMakeDate(new Date());

bookSeatService.updateById(bookSeat);

return R.ok();

}

@RequestMapping("/update2")

public R update2(@RequestBody BookSeatEntity bookSeat){

QueryWrapper<BookSeatEntity> qw=new QueryWrapper<>();

qw.eq("user_id",bookSeat.getUserId());

qw.eq("seat_state",1);

List<BookSeatEntity> count = bookSeatService.list(qw);

if (count.size()>0){

return R.error().put("zwId",count.get(0).getSeatRemark()).put("roomId",count.get(0).getRoomId()).put("id",count.get(0).getId());

}

bookSeat.setMakeDate(new Date());

bookSeatService.updateById(bookSeat);

return R.ok();

}

@RequestMapping("/delete")

public R delete(@RequestBody Integer[] ids){

bookSeatService.removeByIds(Arrays.asList(ids));

return R.ok();

}

}

繼續閱讀