Computer SSM Topic Selection – SSM’s College Campus Ordering System

Project background

Today in the 21st century, with the continuous development and progress of society, people’s scientific understanding of information has developed from low level to high level, from the original perceptual understanding to rational understanding. The importance of management work has gradually been recognized by people. It is understood that scientific management can make information storage accurate, fast and complete, and can improve the efficiency of work management and promote its development.
The paper mainly introduces the university campus meal ordering system, including the current status of the research and the development background involved. Then it also discusses the design goals of the system, the system requirements, the entire design plan, and the impact of the system on The design and implementation were also discussed in detail. Finally, some specific tests were conducted on the university campus ordering system.
This article uses Java as development technology to implement a university campus ordering system. The main users of the university campus ordering system are divided into administrators; personal center, user management, canteen management, canteen menu management, cuisine classification management, message management, message board management, system management, order management, users; personal center, Message message management, my collection management, order management, canteen; personal center, canteen menu management, cuisine classification management, message message management, order management, front desk homepage; homepage, canteen menu, news information, message feedback, mine, jump Go to the backend, shopping cart and other functions. Through the design of these functional modules, the entire university campus ordering system process is basically realized.
Specifically in the system design, the B/S structure is adopted. At the same time, Java technology is also used to design the dynamic page. The Mysql database is used in the background. It is a very excellent university campus ordering system.

Functional design

Function module diagram

Administrator use case

User use cases

System structure diagram

Function screenshot

University campus food ordering system, on the system homepage you can view the homepage, canteen menu, news information, message feedback, mine, jump to the backend, shopping cart and other contents

User registration and user login. On the user registration page, you can fill in account number, password, name, role, gender, age, mobile phone, email and other information for user registration and login.


Canteen menu, on the canteen menu page, fill in the canteen number, canteen name, dishes, cuisines, pictures, portions, ingredients, canteen address, details, prices, total number of seats and other information to add to the shopping cart, book now, click to add to favorites, etc. . On the My Address page, add or reset by filling in information such as contact person, mobile phone number, default address, selected address, etc.


Administrator login, log in by filling in the user name and password

Administrators who log in to the university campus ordering system can view personal center, user management, canteen management, canteen menu management, cuisine classification management, message management, message board management, system management, order management and other information.
User management. In the user management page, you can view, modify, delete and other operations by filling in account number, password, name, role, gender, age, mobile phone, email, photo, balance and other contents.
Canteen management. On the canteen management page, you can view the canteen number, password, canteen name, administrator, canteen photos, hygiene level, contact number, canteen address, balance and other information, and you can view existing canteen management as needed. Modify, delete and other operations.


Cuisine classification management. You can view cuisine and other information on the cuisine classification management page, and you can modify or delete existing cuisine classification management as needed.

Message message management. In the message message management page, you can view information such as account number, name, role, canteen number, canteen name, order number, delivery score, packaging score, dish score, time, suggestions, whether to review, review replies, etc., and can Perform detailed operations such as auditing, viewing, modifying or deleting existing message management as needed.

Message board management. In the message board management page, you can view the message ID, user name, message content, reply content, etc., and perform detailed operations such as viewing, replying, modifying or deleting existing message board management as needed.

Food information management. On the food information management page, you can view titles, introductions, pictures, content, etc., and perform detailed operations such as viewing, modifying, or deleting existing food information management as needed.

Order management, on the order management page you can view the order number, product table name, user ID, product ID, product name, product picture, purchase quantity, price/points, discount price, total price/total points, total discount price, payment Type, status, address and other contents, and conduct detailed operations such as viewing, modifying or deleting existing order management as needed.

If you log in to the university campus ordering system in the canteen, you can view the personal center, canteen menu management, cuisine classification management, message management, order management, etc.
Canteen menu management, on the canteen menu management page, by filling in the canteen number, canteen name, dishes, cuisines, pictures, portions, ingredients, canteen address, details, prices, total number of seats, selected seats and other information, you can also modify the canteen as needed Menu management for viewing, modifying, deleting and other operations.

Cuisine classification management. You can fill in information such as cuisines on the cuisine classification management page, and modify, delete and other detailed operations on existing cuisine classification management as needed.

Order management, on the order management page, fill in the order number, product table name, user ID, product ID, product name, product picture, purchase quantity, price/points, discount price, total price/total points, total discount price, payment Type, status, address and other contents to view, ship and other operations

Users who log in to the university campus ordering system can view personal center, message management, my collection management, order management, etc.
Message message management, on the message message management page, you can also fill in information such as account number, name, role, canteen number, canteen name, order number, delivery score, packaging score, dish score, time, suggestions, whether to review, review reply, etc. View, modify, delete and other operations on message management as needed.

Order management, on the order management page you can view the order number, product table name, user ID, product ID, product name, product picture, purchase quantity, price/points, discount price, total price/total points, total discount price, payment Type, status, address and other information, and view existing order management and other detailed operations as needed

Related code

Database configuration

?

# Tomcat
server:
    tomcat:
        uri-encoding: UTF-8
    port: 8080
    servlet:
        context-path: /springbootr1tjf

spring:
    datasource:
        driverClassName: com.mysql.jdbc.Driver
        url: jdbc:mysql://127.0.0.1:3306/springbootr1tjf?useUnicode=true & amp;characterEncoding=utf-8 & amp;useJDBCCompliantTimezoneShift=true & amp;useLegacyDatetimeCode=false & amp;serverTimezone=GMT+8
        username: root
        password: 123456

# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootr1tjf
# username: sa
# password: 123456

    servlet:
      multipart:
        max-file-size: 10MB
        max-request-size: 10MB
    resources:
      static-locations: classpath:static/,file:static/

#mybatis
mybatis-plus:
  mapper-locations: classpath*:mapper/*.xml
  #Entity scanning, multiple packages separated by commas or semicolons
  typeAliasesPackage: com.entity
  global-config:
    #Primary key type 0: "Database ID auto-increment", 1: "User input ID", 2: "Globally unique ID (numeric type unique ID)", 3: "Globally unique ID UUID";
    id-type: 1
    #Field strategy 0: "Ignore judgment", 1: "Non-NULL judgment"), 2: "Non-NULL judgment"
    field-strategy: 2
    #Camel case underscore conversion
    db-column-underline: true
    #Refresh mapper debugging artifact
    refresh-mapper: true
    #logical deletion configuration
    logic-delete-value: -1
    logic-not-delete-value: 0
    #Custom SQL injector
    sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
  configuration:
    map-underscore-to-camel-case: true
    cache-enabled: false
    call-setters-on-nulls: true
    #springboot project mybatis plus set jdbcTypeForNull (oracle database needs to configure JdbcType.NULL, the default is Other)
    jdbc-type-for-null: 'null'

?

Control layer (controller)

?


    package com.controller;

    import java.util.Arrays;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Map;
    
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.PostMapping;
    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.ResponseBody;
    import org.springframework.web.bind.annotation.RestController;
    
    import com.annotation.IgnoreAuth;
    import com.baomidou.mybatisplus.mapper.EntityWrapper;
    import com.entity.TokenEntity;
    import com.entity.UserEntity;
    import com.service.TokenService;
    import com.service.UserService;
    import com.utils.CommonUtil;
    import com.utils.MPUtil;
    import com.utils.PageUtils;
    import com.utils.R;
    import com.utils.ValidatorUtils;
    
    /**
     * Login related
     */
    @RequestMapping("users")
    @RestController
    public class UserController{<!-- -->
    \t
    @Autowired
    private UserService userService;
    \t
    @Autowired
    private TokenService tokenService;
    
    /**
    \t * Log in
    */
    @IgnoreAuth
    @PostMapping(value = "/login")
    public R login(String username, String password, String captcha, HttpServletRequest request) {<!-- -->
    UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    if(user==null || !user.getPassword().equals(password)) {<!-- -->
    return R.error("Account or password is incorrect");
    }
    String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
    return R.ok().put("token", token);
    }
    \t
    /**
    \t * register
    */
    @IgnoreAuth
    @PostMapping(value = "/register")
    public R register(@RequestBody UserEntity user){<!-- -->
    // ValidatorUtils.validateEntity(user);
        if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {<!-- -->
        return R.error("User already exists");
        }
            userService.insert(user);
            return R.ok();
        }
    
    /**
    \t * quit
    */
    @GetMapping(value = "logout")
    public R logout(HttpServletRequest request) {<!-- -->
    request.getSession().invalidate();
    return R.ok("Exit successfully");
    }
    \t
    /**
         * reset Password
         */
        @IgnoreAuth
    @RequestMapping(value = "/resetPass")
        public R resetPass(String username, HttpServletRequest request){<!-- -->
        UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
        if(user==null) {<!-- -->
        return R.error("Account does not exist");
        }
        user.setPassword("123456");
            userService.update(user,null);
            return R.ok("Password has been reset to: 123456");
        }
    \t
    /**
         * list
         */
        @RequestMapping("/page")
        public R page(@RequestParam Map<String, Object> params,UserEntity user){<!-- -->
            EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
        PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
            return R.ok().put("data", page);
        }
    
    /**
         * list
         */
        @RequestMapping("/list")
        public R list( UserEntity user){<!-- -->
           EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
          ew.allEq(MPUtil.allEQMapPre( user, "user"));
            return R.ok().put("data", userService.selectListView(ew));
        }
    
        /**
         * information
         */
        @RequestMapping("/info/{id}")
        public R info(@PathVariable("id") String id){<!-- -->
            UserEntity user = userService.selectById(id);
            return R.ok().put("data", user);
        }
        
        /**
         * Get the user's session user information
         */
        @RequestMapping("/session")
        public R getCurrUser(HttpServletRequest request){<!-- -->
        Long id = (Long)request.getSession().getAttribute("userId");
            UserEntity user = userService.selectById(id);
            return R.ok().put("data", user);
        }
    
        /**
         * save
         */
        @PostMapping("/save")
        public R save(@RequestBody UserEntity user){<!-- -->
    // ValidatorUtils.validateEntity(user);
        if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {<!-- -->
        return R.error("User already exists");
        }
            userService.insert(user);
            return R.ok();
        }
    
        /**
         * Revise
         */
        @RequestMapping("/update")
        public R update(@RequestBody UserEntity user){<!-- -->
    // ValidatorUtils.validateEntity(user);
        UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
        if(u!=null & amp; & amp; u.getId()!=user.getId() & amp; & amp; u.getUsername().equals(user.getUsername())) {<!-- -->
        return R.error("Username already exists.");
        }
            userService.updateById(user);//Update all
            return R.ok();
        }
    
        /**
         * delete
         */
        @RequestMapping("/delete")
        public R delete(@RequestBody Long[] ids){<!-- -->
            userService.deleteBatchIds(Arrays.asList(ids));
            return R.ok();
        }
    }



Business layer (Service)

?


    package com.service;
    
    import java.util.List;
    import java.util.Map;
    
    import org.apache.ibatis.annotations.Param;
    
    import com.baomidou.mybatisplus.mapper.Wrapper;
    import com.baomidou.mybatisplus.service.IService;
    import com.entity.UserEntity;
    import com.utils.PageUtils;

    /**
     * system user
     */
    public interface UserService extends IService<UserEntity> {<!-- -->
     PageUtils queryPage(Map<String, Object> params);
        
       List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
       \t
       PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
    \t   \t
    }


Data access layer (Dao)

?

package com.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;

/**
 * User
 */
public interface UserDao extends BaseMapper<UserEntity> {<!-- -->
\t
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);

List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);
\t
}

?
?

Project acquisition:

https://gitee.com/sinonfin/L-javaWebSha/tree/master