微信小程序图书馆座位预约管理系统
生活随笔
收集整理的這篇文章主要介紹了
微信小程序图书馆座位预约管理系统
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
開發(fā)工具:IDEA、微信小程序
服務器:Tomcat9.0, jdk1.8
項目構建:maven
數(shù)據(jù)庫:mysql5.7
前端技術:vue、uniapp
服務端技術:springboot+mybatis
本系統(tǒng)分微信小程序和管理后臺兩部分,項目采用前后端分離
項目功能描述:
1.微信小程序:登錄、注冊、主頁、公告、輪播圖、圖書館預約(座位選擇、時間選擇),圖書借閱、個人中心(預約狀態(tài)、掃碼簽到、修改密碼、設置、退出登錄)
2.后臺管理:登錄、修改密碼、系統(tǒng)管理(用戶管理、角色管理、菜單管理、組織管理)、圖書館管理、座位管理、通知管理、預約管理、借閱管理、圖書管理
文檔截圖:
微信小程序截圖:
后臺截圖:
package com.yiyue.service.wx;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.yiyue.common.util.PageUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.apache.commons.lang3.StringUtils; import com.yiyue.model.bean.wx.NoticeAdvise; import com.yiyue.model.dto.wx.NoticeAdviseDTO; import com.yiyue.mapper.wx.NoticeAdviseMapper;@Service @Transactional public class NoticeAdviseService {@Autowiredprivate NoticeAdviseMapper noticeAdviseMapper;public IPage<NoticeAdvise> findNoticeAdviseListPageByParam(NoticeAdviseDTO noticeAdviseDTO) {// 從dto對象中獲得查詢條件,添加到queryWrapper對象中, 查詢條件還需要視情況自行修改QueryWrapper<NoticeAdvise> queryWrapper=getQueryWrapper(noticeAdviseDTO);IPage<NoticeAdvise> noticeAdviseList=noticeAdviseMapper.findNoticeAdvisePageList(PageUtil.getPagination(noticeAdviseDTO),queryWrapper);return noticeAdviseList;}private QueryWrapper getQueryWrapper(NoticeAdviseDTO noticeAdviseDTO){QueryWrapper<NoticeAdvise> queryWrapper=new QueryWrapper<>();// 序號if(!StringUtils.isBlank(noticeAdviseDTO.getId())){queryWrapper.eq("id",noticeAdviseDTO.getId());}// 標題if(!StringUtils.isBlank(noticeAdviseDTO.getTitle())){queryWrapper.like("title","%"+noticeAdviseDTO.getTitle()+"%");}// 內(nèi)容if(!StringUtils.isBlank(noticeAdviseDTO.getNoticeContent())){queryWrapper.eq("notice_content",noticeAdviseDTO.getNoticeContent());}// 時間if(!StringUtils.isBlank(noticeAdviseDTO.getCreateDate())){queryWrapper.eq("create_date",noticeAdviseDTO.getCreateDate());}return queryWrapper;}public void insertNoticeAdvise(NoticeAdvise noticeAdvise) {noticeAdviseMapper.insert(noticeAdvise);}public void updateNoticeAdvise(NoticeAdvise noticeAdvise) {this.noticeAdviseMapper.updateById(noticeAdvise);}public void deleteNoticeAdviseById(String id) {this.noticeAdviseMapper.deleteById(id);}public NoticeAdvise findNoticeAdviseById(String id) {return noticeAdviseMapper.selectById(id);}} package com.yiyue.service.wx;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.yiyue.common.util.PageUtil; import com.yiyue.mapper.wx.SeatStatusMapper; import com.yiyue.model.bean.wx.SeatStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.apache.commons.lang3.StringUtils; import com.yiyue.model.bean.wx.OrderMange; import com.yiyue.model.dto.wx.OrderMangeDTO; import com.yiyue.mapper.wx.OrderMangeMapper;import java.text.SimpleDateFormat; import java.util.Date; import java.util.List;@Service @Transactional public class OrderMangeService {@Autowiredprivate OrderMangeMapper orderMangeMapper;@Autowiredprivate SeatStatusMapper seatStatusMapper;public IPage<OrderMange> findOrderMangeListPageByParam(OrderMangeDTO orderMangeDTO) {// 從dto對象中獲得查詢條件,添加到queryWrapper對象中, 查詢條件還需要視情況自行修改QueryWrapper<OrderMange> queryWrapper=getQueryWrapper(orderMangeDTO);IPage<OrderMange> orderMangeList=orderMangeMapper.findOrderMangePageList(PageUtil.getPagination(orderMangeDTO),queryWrapper);return orderMangeList;}private QueryWrapper getQueryWrapper(OrderMangeDTO orderMangeDTO){QueryWrapper<OrderMange> queryWrapper=new QueryWrapper<>();// 序號if(!StringUtils.isBlank(orderMangeDTO.getId())){queryWrapper.eq("s1.id",orderMangeDTO.getId());}// 訂單編號if(!StringUtils.isBlank(orderMangeDTO.getOrderId())){ // queryWrapper.eq("s1.order_id",orderMangeDTO.getOrderId());queryWrapper.eq("s1.id",orderMangeDTO.getOrderId());}// 用戶if(!StringUtils.isBlank(orderMangeDTO.getUserId())){queryWrapper.eq("s1.user_id",orderMangeDTO.getUserId());}// 圖書館idif(!StringUtils.isBlank(orderMangeDTO.getLibraryId())){queryWrapper.eq("s1.library_id",orderMangeDTO.getLibraryId());}// 圖書館if(!StringUtils.isBlank(orderMangeDTO.getLibraryName())){queryWrapper.eq("s1.library_name",orderMangeDTO.getLibraryName());}// 座位idif(!StringUtils.isBlank(orderMangeDTO.getSeatId())){queryWrapper.eq("s1.seat_id",orderMangeDTO.getSeatId());}// 座位if(!StringUtils.isBlank(orderMangeDTO.getSeatName())){queryWrapper.eq("s1.seat_name",orderMangeDTO.getSeatName());}// 訂單狀態(tài)if(!StringUtils.isBlank(orderMangeDTO.getOrderStatus())){queryWrapper.eq("s1.order_status",orderMangeDTO.getOrderStatus());}// 預約時間if(!StringUtils.isBlank(orderMangeDTO.getPlanTime())){queryWrapper.eq("s1.plan_time",orderMangeDTO.getPlanTime());}// 創(chuàng)建時間if(!StringUtils.isBlank(orderMangeDTO.getCreateDate())){queryWrapper.eq("create_date",orderMangeDTO.getCreateDate());}return queryWrapper;}public void insertOrderMange(OrderMange orderMange) {orderMangeMapper.insert(orderMange);}public void updateOrderMange(OrderMange orderMange) {this.orderMangeMapper.updateById(orderMange);}public void deleteOrderMangeById(String id) {this.orderMangeMapper.deleteById(id);}public OrderMange findOrderMangeById(String id) {return orderMangeMapper.selectById(id);}public int findUserIdOrOrder(String userId) {QueryWrapper<OrderMange> queryWrapper = new QueryWrapper<>();queryWrapper.eq("user_id",userId);queryWrapper.eq("order_status",0);return orderMangeMapper.selectCount(queryWrapper);}public OrderMange findOrderState(OrderMangeDTO orderMangeDTO) {QueryWrapper<OrderMange> queryWrapper = new QueryWrapper<>();queryWrapper.eq("user_id",orderMangeDTO.getUserId());queryWrapper.eq("order_status",0);if (orderMangeMapper.selectList(queryWrapper).size()==0){return null;}return orderMangeMapper.selectList(queryWrapper).get(0);}public void findSeatState(String id) {OrderMange orderMange = orderMangeMapper.selectById(id);int seatId = orderMange.getSeatId();SeatStatus seatStatus = new SeatStatus();seatStatus.setId(seatId);seatStatus.setStatus(0);seatStatusMapper.updateById(seatStatus);}public void selectOrOrderState() {//取消座位預約findSeatStateSimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");/* QueryWrapper<OrderMange> queryWrapper = new QueryWrapper<>();queryWrapper.eq("order_status","0");*/List<OrderMange> list = orderMangeMapper.selectList(null);if (list.size()==0){return;}for (int i = 0; i < list.size(); i++) {Date planDate = new Date(list.get(i).getPlanTime().getTime() + 900000);if (planDate.getTime()<new Date().getTime()){orderMangeMapper.deleteById(list.get(i).getId());SeatStatus seatStatus = new SeatStatus();seatStatus.setId(list.get(i).getSeatId());seatStatus.setStatus(0);seatStatusMapper.updateById(seatStatus);}}//時間到時的確認時間QueryWrapper<OrderMange> queryWrapper2 = new QueryWrapper<>();queryWrapper2.eq("order_status","1");List<OrderMange> list2 = orderMangeMapper.selectList(queryWrapper2);if (list.size()==0){return;}for (int i = 0; i < list2.size(); i++) {if (list2.get(i).getEndTime().getTime()<new Date().getTime()){orderMangeMapper.deleteById(list.get(i).getId());SeatStatus seatStatus = new SeatStatus();seatStatus.setId(list.get(i).getSeatId());seatStatus.setStatus(0);seatStatusMapper.updateById(seatStatus);}}} } package com.yiyue.service.wx;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yiyue.common.util.PageUtil;
import com.yiyue.common.vo.ItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;
import com.yiyue.model.bean.wx.SeatStatus;
import com.yiyue.model.dto.wx.SeatStatusDTO;
import com.yiyue.mapper.wx.SeatStatusMapper;
import java.util.ArrayList;
import java.util.List;
@Service
@Transactional
public class SeatStatusService {
@Autowired
private SeatStatusMapper seatStatusMapper;
public IPage<SeatStatus> findSeatStatusListPageByParam(SeatStatusDTO seatStatusDTO) {
// 從dto對象中獲得查詢條件,添加到queryWrapper對象中, 查詢條件還需要視情況自行修改
QueryWrapper<SeatStatus> queryWrapper=getQueryWrapper(seatStatusDTO);
IPage<SeatStatus> seatStatusList=seatStatusMapper.findSeatStatusPageList(PageUtil.getPagination(seatStatusDTO),queryWrapper);
return seatStatusList;
}
private QueryWrapper getQueryWrapper(SeatStatusDTO seatStatusDTO){
QueryWrapper<SeatStatus> queryWrapper=new QueryWrapper<>();
// 序號
if(!StringUtils.isBlank(seatStatusDTO.getId())){
queryWrapper.eq("id",seatStatusDTO.getId());
}
// 狀態(tài)(0空閑;1預約;2占用)
if(!StringUtils.isBlank(seatStatusDTO.getStatus())){
queryWrapper.eq("status",seatStatusDTO.getStatus());
}
// 座位
if(!StringUtils.isBlank(seatStatusDTO.getSeatName())){
queryWrapper.eq("seat_name",seatStatusDTO.getSeatName());
}
// 圖書館
if(!StringUtils.isBlank(seatStatusDTO.getLibraryType())){
queryWrapper.eq("library_type",seatStatusDTO.getLibraryType());
}
return queryWrapper;
}
public void insertSeatStatus(SeatStatus seatStatus) {
seatStatusMapper.insert(seatStatus);
}
public void updateSeatStatus(SeatStatus seatStatus) {
this.seatStatusMapper.updateById(seatStatus);
}
public void deleteSeatStatusById(String id) {
this.seatStatusMapper.deleteById(id);
}
public SeatStatus findSeatStatusById(String id) {
return seatStatusMapper.selectById(id);
}
public List<ItemVO> findSeatListName(String typeId) {
ArrayList<ItemVO> arrayList = new ArrayList<>();
QueryWrapper<SeatStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("library_type",typeId);
queryWrapper.eq("status",0);
List<SeatStatus> seatStatusList=this.seatStatusMapper.selectList(queryWrapper);
seatStatusList.forEach(item->{
ItemVO itemVO = new ItemVO();
itemVO.setKey(item.getId()+"");
itemVO.setValue(item.getId()+"");
itemVO.setTitle(item.getSeatName());
arrayList.add(itemVO);
});
return arrayList;
}
public List<SeatStatus> findSeatListGetLibrary(int id) {
QueryWrapper<SeatStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("library_type",id);
List<SeatStatus> list = seatStatusMapper.selectList(queryWrapper);
return list;
}
}
總結
以上是生活随笔為你收集整理的微信小程序图书馆座位预约管理系统的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 协同过滤(英语:Collaborativ
- 下一篇: 线性代数 1