Web-based meal ordering system for epidemic isolation zones

1. Project introduction

The purpose of this project is to use the trend of Internet development and related web application development technology to improve the vitality and vitality of the catering industry, while contributing their own ideas and technologies to the epidemic. As we all know, when the new crown epidemic spread by foam leads to the weakness of offline catering industry, from another point of view, it greatly promotes the process of offline transition of catering industry. A catering system for epidemic situation can play a very important role in epidemic control and effective control of the spread of epidemic. The design and implementation of a Web-based meal ordering system for epidemic isolation zones is a summary and test of the academic situation during the University period, and it is a new challenge to test your own production and the ability to solve software development technology. I can fully recognize my own shortcomings and shortcomings, and give myself a positioning and direction to step into society.

The significance of this project is to reduce the impact of the epidemic on the small-scale food and beverage industry, improve the vitality of the future food and beverage industry and provide assistance in the control of the epidemic, reduce the contact between people, and reduce or even block the epidemic transmission in food and beverage at all levels of society. For the future focus of the work in the catering industry, as well as contributing to the prevention and control of epidemics in the catering industry, one of their own ideas, and how to develop their own characteristics and advantages in the existing platforms, put forward an idea of their own platform can kill the encirclement of the way of life and characteristics in many catering platforms. I need to point out that the focus of this project is on how to rescue the development of the small-scale catering industry under the epidemic situation, to provide a central guidance for the development of the small-scale catering industry during the epidemic, to provide a simple and comfortable ordering website for the people in the epidemic isolation area, and to help control the epidemic.

The users of the SSM quarantine meal ordering system mainly contain two user roles, one is the administrator role and the other is the foreground user role. The specific functions of these two roles are as follows:

Administrator role: Administrators login to the quarantine meal ordering system can perform corresponding management operations, mainly including user management, food management, order management, classification management, announcement management, news management, employee health management, message management, etc.

Front Desk User Role: Front Desk users can browse meals, add shopping carts, shopping cart management, purchase meals, personal order management, personal center management and other operations after they log on to the quarantine ordering system.

2. Introduction to the environment

Language environment: Java: jdk1.8

Database: Mysql: mysql5.7

Application Server: Tomcat: Tomcat 8.5.31

Development tools: IDEA or eclipse

Background development technology: Springboot+Mybatis

Foreground development technology: Bootstrap+Jquery+Ajax

3. Systematic display

Display of foreground user function module

Foreground User Browse Commodity Module

Front-end users of the quarantine ordering system can view the corresponding meal information in the store without registering to log on. The specific operation interface is shown in Figure 3-1 below.

Figure 3-1 Front end user browsing commodity interface

Front End User Shopping Cart Module

Afterwards, front-end users of the quarantine ordering system can add the meals they need to buy to the shopping cart. Add shopping cart operation interface as shown in Figure 3-2 below.

Figure 3-2 Front end user adds shopping cart interface

Foreground User Purchase Commodity Module

Front end users can add their favorite meals to the shopping cart, submit an order and pay for the purchase when they log on to the mall system. After purchasing a product, you can rate the service of the system, the speed of logistics, the attitude of customer service, etc. and comment on the product. The related management operation interfaces are shown in Figures 3-3 and 3-4 below.

Figure 3-3 Front-end user shopping interface

Figure 3-4 Front End User Payment Interface

Foreground User Personal Order Management Module

Background users of quarantine meal ordering system can manage individual order information in the personal order management module after they log on to the system. The front end user's personal order management operation interface is shown in Figure 3-5 below.

Figure 3-5 Front End User Personal Order Management Operational Interface

3.1.5 Front Desk User Receipt Address Management Module

After foreground users log on to the quarantine ordering system, they can manage individual receipt address information in the user center management module. The front end user's personal receipt address management operation interface is shown in Figure 3-6 below.

Figure 3-6 Front End User Personal Receipt Address Management Interface

3.1.6 Foreground User News Viewing Module

The foreground users of the quarantine meal ordering system can browse the latest news released in the epidemic news after they log on to the system. The front-end user's personal news viewing interface is shown in Figure 3-7 below.

Figure 3-7 Front End User News Viewing Interface

Display of Background Function Modules

User login function

Background users of the food ordering system in the epidemic isolation area can only perform related operations if they want to manage information about the food ordering system by logging in to the system first. The user login interface is shown in Figure 3-8 below.

Figure 3-8 Background user login interface

User management functions

After the epidemic quarantine meal ordering system administrator user logs on to the system, he can enter the user management menu to manage the corresponding user information, mainly to add, modify, delete, query, disable and enable users. The user management interface is shown in Figure 3-9 below:

Figure 3-9 Background User Management Function Interface Diagram

Function of categorization management of meals

After the epidemic quarantine ordering system administrator user logs on to the system, he can enter the secondary menu in the product management menu for the corresponding categorization information management. The categorization interface is shown in Figure 3-10 below.

Figure 6-10 UI interface for categorization management function

Announcement Information Management Operation UI

After the users of the epidemic quarantine ordering system administrator log on to the system, they can enter the announcement management module for platform announcement information management. The announcement management operation interface is shown in Figure 3-11 below.

Figure 3-11 UI interface for bulletin information management function

Background commodity management operation UI

After the administrator of the food ordering system in the epidemic isolation area has logged on to the system, he or she can enter the commodity management menu for commodity information management. It mainly includes the operation of adding, modifying, querying and deleting commodities. When adding commodities, the pictures of uploaded commodities can be displayed. The operational interface of commodity information management is shown in Figure 3-9 below.

Figure 3-12 Background Commodity Management UI Interface

Background commodity transaction management operation UI

After the administrator of the food ordering system in the epidemic isolation area has logged on to the system, he or she can enter the commodity transaction management menu to manage the commodity transaction information and the transaction statistics. It mainly includes inquiry of commodity orders, detailed view of orders, order shipment, etc. When adding commodities, you can upload pictures of commodities for display. The commodity transaction management operation interface is shown in Figure 6-13 below.

Figure 3-13 Background Commodity Trading Management UI Interface

Background commodity sales statistics management operation UI

After the administrator of the ordering system in the epidemic isolation area has logged on to the system, he or she can enter the sales statistics management menu to make statistics on the sales of the corresponding goods. It is mainly displayed in the form of graphic reports, mainly in the form of pie chart and column status chart. Displayed pictures can be downloaded or printed online. The commodity statistics view interface is shown in Figure 6-14 below.

Figure 3-14 Background Commodity Trading Statistics UI Interface

3.2.8 Background Epidemic News Management Operational UI

After the administrator of the ordering system in the epidemic isolation area logs on to the system, he can enter the epidemic news management menu to publish and manage the latest epidemic situation. The epidemic news management interface is shown in Figure 3-15 below.

Figure 3-15 UI interface for epidemic news management function

3.2.9 Background Employee Health Management Operational UI

After login, the health status and temperature information of the restaurant staff is entered daily so that the health system staff can check regularly and ensure the health status of the staff. The health management interface for employees during the epidemic is shown in Figure 3-16 below.

Figure 3-16 Epidemic News Management UI Interface

Fourth, core code display

package com.ms.diancan.controller.web;

import com.ms.diancan.entity.Role;
import com.ms.diancan.entity.User;
import com.ms.diancan.service.RoleService;
import com.ms.diancan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * @author me
 * @createTime 2022-03-17 09:33
 */

@Controller
public class Back_AdminController {

    @Autowired
    private UserService userService;
    @Autowired
    private RoleService roleService;

    @GetMapping("/admin/toMemberList")
    public String toMemberList(Model model){

        List<User> allUser = userService.findAllUser();
        List<Role> roleList  = roleService.findRoleList();
        model.addAttribute("userList",allUser);
        model.addAttribute("roleList", roleList);
        return "/admin/member/member_list";
    }

    /**
     *
     * @param session  The session passed from the foreground to the administrator with the user object in it
     */
    @GetMapping("/admin/personalInfo")
    public String findUserByUserId(HttpSession session, Model model){
        Integer userId = ((User) session.getAttribute("user")).getId();
        User user = userService.findUserInfo(userId);
        model.addAttribute("user", user);
        return "/admin/member/personal_info";
    }

    @PostMapping("/admin/updateAdmin")
    public String updateUser(User user) {
        userService.updateUser(user);
        return "redirect:/admin/personalInfo";
    }


    @GetMapping("/admin/updateAdminById")
    public String updateUserById(User user) {
        userService.updateUserById(user);
        return "redirect:/admin/personalInfo";
    }

    @RequestMapping("/admin/check")
    @ResponseBody
    public String checkPassowrd(User user, String npassword){

        User myuser = userService.findUserId(user.getId());
        String password = myuser.getPassword();
        if(user.getPassword().equals(password)){
            user.setPassword(npassword);
            userService.updateUserPassword(user);
            return "true";
        }else{
            return "false";
        }
    }

    @RequestMapping("/addAdmin")
    public String addAdmin(User user) {

        userService.addUser(user);

        return "redirect:/admin/toMemberList";
    }

    @RequestMapping("/deleteAdmins")
    public String deleteAdmins(@RequestParam("userId") String[] userIds){
        userService.deleteAdminsById(userIds);
        return "redirect:/admin/toMemberList";
    }

    @RequestMapping("/admin/selectUser")
    public String selectUser(String userName, Model model){
        List<User> dbUserList = userService.findUserByUsername(userName);
        model.addAttribute("userList", dbUserList);
        return "/admin/member/member_list";
    }

    @PostMapping("/admin/stopStatus")
    public void stopState(String userId) {
        int status = 0;
        userService.updateUserStatus(userId, status);
    }

    @PostMapping("/admin/startStatus")
    public void startState(String userId) {
        int status = 1;
        userService.updateUserStatus(userId, status);
    }

    @RequestMapping("/admin/deleteUserById")
    public void deleteUserById(String userId) {
        userService.deleteUserById(userId);
    }

    @RequestMapping("/adminCompetence")
    public String adminCompetence(Model model) {
        List<User> userList = userService.findAdminList();

        String pRoleName = "";
        String sRoleName = "";
        int pCount = 0;
        int sCount = 0;
        for(User user : userList){
        /*    if("Super Administrator'.equals (user.getRole().getRoleName()) {
                sRoleName = sRoleName + " " + user.getUsername();
                sCount = sCount + 1;
            }else{
                pRoleName = pRoleName + "  " + user.getUsername();
                pCount = pCount + 1;
            }*/
        }

        model.addAttribute("pRoleName", pRoleName);
        model.addAttribute("pCount", pCount);
        model.addAttribute("sRoleName" , sRoleName);
        model.addAttribute("sCount", sCount);
        return "/admin/member/admin_competence";
    }

}

package com.ms.diancan.controller.web;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ms.diancan.entity.Product;
import com.ms.diancan.entity.vo.OrderAddressCountVO;
import com.ms.diancan.entity.vo.OrderStatusCountVO;
import com.ms.diancan.service.EchartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLOutput;
import java.util.List;

/**
 * @author me    hart Diagram showing related controller s
 * @createTime 2022-02-14 09:39
 */

@RestController
public class Back_EchartsController {

    @Autowired
    private EchartsService echartsService;

    @PostMapping("/admin/buyCount")
    public Object getBuyCount() throws JsonProcessingException {
        List<Product> proList= echartsService.findAll();
        ObjectMapper mapper=new ObjectMapper();
        String json=mapper.writeValueAsString(proList);
        System.out.println(json);
        return json;
    }

   @PostMapping("/admin/buyAddr")
    public Object getBuyAddr() throws JsonProcessingException {
        List<OrderAddressCountVO> ordList=echartsService.findAllAddr();
        ObjectMapper mapper=new ObjectMapper();
        String json=mapper.writeValueAsString(ordList);
        return json;
    }

    @PostMapping("/admin/orderStatus")
    public Object getOrderStatus() throws JsonProcessingException {
        List<OrderStatusCountVO> orderStatusList = echartsService.findAllOrderStatus();

        orderStatusList.forEach((OrderStatusCountVO)->{
            System.out.println(OrderStatusCountVO.getOrderStatus());
            System.out.println(OrderStatusCountVO.getCount());
        });
        ObjectMapper mapper=new ObjectMapper();
        String json=mapper.writeValueAsString(orderStatusList);
        return json;
    }



}

package com.ms.diancan.controller.web;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ms.diancan.entity.Emp;
import com.ms.diancan.entity.News;
import com.ms.diancan.entity.dto.EmpDTO;
import com.ms.diancan.service.EmpService;
import com.ms.diancan.service.NewsService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoProperties;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author me  Employee health management related controller s
 * @createTime 2022-04-15 19:11
 */
@Controller
public class Back_EmpController {
    @Autowired
    private EmpService empService;

    /**
     * Show Daily Employee Health Management List
     * @return
     */
    @RequestMapping("/admin/toEmpList")
    public String sortAds(@RequestParam(required = true, defaultValue = "1") Integer page,Model model) {
        PageHelper.startPage(page, 10);
        List<Emp> empList = empService.findAll();
        model.addAttribute("empList",empList);
        PageInfo<Emp> p = new PageInfo<Emp>(empList);
        model.addAttribute("page", p);
        return "/admin/emp/emp_list";
    }

    /**
     * Create employee health
     */
    @RequestMapping("/admin/createEmp")
    public  String createEmp(Emp emp){
        empService.addEmp(emp);
        return "redirect:/admin/toEmpList";
    }

    /**
     * Modify employee health
     */
    @RequestMapping("/admin/updateEmp")
    public  String updateEmp(EmpDTO empDto){
        Emp emp = new Emp();
        emp.setId(empDto.getId());
        emp.setEname(empDto.getUename());
        emp.setEcard(empDto.getUecard());
        emp.setEsex(empDto.getUesex());
        emp.setEphone(empDto.getUephone());
        emp.setEdesc(empDto.getUedesc());
        emp.setEtiwen(empDto.getUetiwen());
        emp.setEstatus(empDto.getUestatus());
        emp.setEdate(empDto.getUedate());
        empService.updateEmp(emp);
        return "redirect:/admin/toEmpList";
    }

    /**
     * Bulk Delete Employee Health
     */
    @RequestMapping("/admin/deleteBatchEmps")
    public  String deleteBatchEmps(@RequestParam("id") Integer[] id){
        empService.deleteEmps(id);
        return "redirect:/admin/toEmpList";
    }

    /**
     * Mass display of employee health - not enabled
     */
    @RequestMapping("/admin/showBatchEmps")
    public  String showBatchEmps(@RequestParam("id") Integer[] id){
        empService.showEmps(id);
        return "redirect:/admin/toEmpList";
    }

    /**
     * Batch shutdown of employee health - not enabled
     */
    @RequestMapping("/admin/closeBatchEmp")
    public  String closeBatchEmp(@RequestParam("id") Integer[] id){
        empService.closeEmps(id);
        return "redirect:/admin/toEmpList";
    }

}
package com.ms.diancan.controller.web;

import com.ms.diancan.entity.Leave;
import com.ms.diancan.entity.User;
import com.ms.diancan.enums.UserRoleEnum;
import com.ms.diancan.mapper.LeaveMapper;
import com.ms.diancan.mapper.UserMapper;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.jws.WebParam;
import javax.servlet.http.HttpSession;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author me
 * @createTime 2022-03-18 13:45
 */

@Controller
public class Back_HomeController {

    @Autowired
    private UserMapper userMapper;
    @Autowired
    private LeaveMapper leaveMapper;

    /**
     * Background login system
     */
    @RequestMapping("/admin/index")
    public String adminLogin() {
       return "/admin/common/login";
    }

    @PostMapping("/admin/backLogin")
    public String backLogin(User user, Model model){
        User dbUser = userMapper.findUserByU_P(user.getUserName(),user.getPassword());
        //1-Return directly if no login account exists
        if(dbUser == null){
            model.addAttribute("errorInfo","ERROR Incorrect username or password~~");
            return "/admin/common/login";
        }
        //2-Determine Administrator Status if Login Account exists
        if(dbUser.getRoleId() == 1){
            Subject subject = SecurityUtils.getSubject();
            //2-1-Query unread messages
            List<Leave> messageList = leaveMapper.findAllLeaveList()
                    .stream().filter(leave -> leave.getStatus() == 0).collect(Collectors.toList());
            model.addAttribute("messageNum",messageList.size());
            subject.getSession().setAttribute("user",dbUser);
            return "/admin/common/index";
        }
        //3-If not an administrator, return to the login interface
        model.addAttribute("errorInfo","Non-administrators cannot log on to the background management system~~");
        return "/admin/common/login";
    }

    @RequestMapping("/admin/home")
    public String home() {
        //Jump back to user list page
        return "/admin/common/home";
    }

    @RequestMapping("/brandManage")
    public String brandManage() {
        return "/admin/Brand_Manage";
    }

    @RequestMapping("toProduct_category_add")
    public String toProduct_category_add(){
        return "/admin/product-category-add";
    }

    @RequestMapping("/advertising")
    public String advertising() {
        return "/admin/advertising";
    }

    @RequestMapping("/admin/transaction")
    public String transaction() {
        return "/admin/order/transaction";
    }
    @RequestMapping("/amounts")
    public String amounts() {
        return "/admin/Amounts";
    }
    @RequestMapping("/orderHandling")
    public String orderHandling() {
        return "/admin/Order_handling";
    }
    @RequestMapping("/coverManagement")
    public String coverManagement() {
        return "/admin/Cover_management";
    }
    @RequestMapping("/userList")
    public String userList() {
        return "/admin/user_list";
    }
    @RequestMapping("/memberGrading")
    public String memberGrading() {
        return "/admin/member-Grading";
    }
    @RequestMapping("/integration")
    public String integration() {
        return "/admin/integration";
    }
    @RequestMapping("/feedBack")
    public String feedBack() {
        return "/admin/Feedback";
    }
    @RequestMapping("/systems")
    public String systems() {
        return "/admin/Systems";
    }
    /*  @RequestMapping("/menuManage")
      public String menuManage() {
          return "/admin/test";
      }*/
    @RequestMapping("/userManage")
    public String userManage() {
        return "/admin/test";
    }
    /* */
    @RequestMapping("/systemSet")
    public String systemSet() {
        return "/admin/Systems";
    }

}

V. Project Summary

This system avoids the limitations caused by most of the food ordering platforms that can not meet the needs of people in quarantine areas for ordering food, and has a certain relevance for epidemic prevention. The specific functions are as follows:

(1) To improve efficiency and provide convenience for users to buy and sell goods.

(2) Provides administrators with the ability to add and remove users and to modify user passwords.

(3) Provide administrators with the functions of publishing, querying, modifying, browsing and purchasing goods.

(4) Provide administrators with the functions of adding and managing commodity classification, epidemic situation announcement information and user information management.

(5) Provide administrators with the ability to add, modify and delete epidemic prevention and control information.

Tags: Java Front-end programming language

Posted by witold on Wed, 14 Sep 2022 21:01:42 +0300