β
Research background:
With the rapid development of information technology and network, computers are rapidly popularized in today's world. People's lifestyle has led to the era of network. The informatization level of almost every industry is getting higher and higher. Social and economic development is the main power network. With the increasing importance of education in China, the number of students in schools is increasing, and students' campus life is becoming more and more wonderful, Team competition is becoming more and more abundant. In the process of competition, applications and submission and registration of past papers are not only a waste of resources, but also low office efficiency. If there are many events and the contents of employees are plundered, the charging will certainly increase a lot of difficulty.
Therefore, the realization of information management of College Students' competition can not only improve the management efficiency of competition projects, but also bring a lot of convenience to users. College Students' competition declaration management system is a system with project declaration and project enrollment statistics as the core function. It queries whether the number of students participating in the competition conflicts with the maximum number of students that the project can accommodate, and plays an important role in project management. Therefore, the college student competition application management system can provide teachers and students with sufficient information and fast query means, facilitate the project manager to increase or decrease the layout of the examination room, and avoid the occurrence of problems such as competitiveness conflict.
In the past, the project management of most competitions was the simplest manual management. The monitor took the lead to inform, the monitor communicated the notice in the class, and the students applied to participate in the activities. The information was collected by the monitor, and finally the school leaders classified and calculated the list of all participating students, resulting in heavy workload of project competition management, real-time understanding of the use and low work efficiency. Therefore, the design of College Students' competition application management system has very important practical significance.
π Get the source code at the end of the article π
click View full video
System function design
(1) Login: enter the account password and verification code to login;
(2) User information module
(3) Menu module
(4) Role module
(5) Project competition activity application module
(6) Project competition Fund Application module
(7) Project competition activity management approval module
(8) Project individual competition registration module
(9) Project team competition registration module
(10) Project conclusion statistics module
(11) Notification and announcement module
β
Screenshot of main functions:
User login: enter the account password and verification code to log in. After login, different menus and roles are displayed according to the user's authority, which can be controlled flexibly.
β
Administrator function module: user information management, role information management, menu information management, authority information management, competition registration information management, fund application information and x audit information management, project conclusion information management, project application information management and other specific function modules
β
User management: user list display, data addition, deletion and modification.
β
β
Role management: by binding roles to users, role control menu is flexible and menu permission is displayed. Users can create multiple roles
β
Menu message management:
β
System log monitoring: aop aspect programming and log recording operation
β
Business function module;
Project initiation application function:
β
β
Project approval function:
β
Activity budget application:
β
β
Project initiation application, individual competition and team competition registration management: enter the registration related information fields,
β
β
β
Project conclusion management information:
β
After the project is completed, select the project for fund use statistics and conclusion. Enter amount
β
β
Statistics of project conclusion:
β
Main data sheet design:
User table:
CREATE TABLE `NewTable` ( `user_id` bigint(20) NOT NULL AUTO_INCREMENT , `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'user name' , `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'password' , `salt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'salt' , `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'mailbox' , `mobile` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'cell-phone number' , `status` tinyint(4) NULL DEFAULT NULL COMMENT 'Status 0: Disabled 1: normal' , `dept_id` bigint(20) NULL DEFAULT NULL COMMENT 'department ID' , `create_time` datetime NULL DEFAULT NULL COMMENT 'Creation time' , PRIMARY KEY (`user_id`), UNIQUE INDEX `username` (`username`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='System user' AUTO_INCREMENT=3 ROW_FORMAT=COMPACT
Menu table:
CREATE TABLE `NewTable` ( `menu_id` bigint(20) NOT NULL AUTO_INCREMENT , `parent_id` bigint(20) NULL DEFAULT NULL COMMENT 'Parent menu IDοΌThe first level menu is 0' , `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Menu name' , `url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'menu URL' , `perms` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'to grant authorization(Multiple are separated by commas, such as: user:list,user:create)' , `type` int(11) NULL DEFAULT NULL COMMENT 'Type 0: Catalog 1: menu 2: button' , `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Menu icon' , `order_num` int(11) NULL DEFAULT NULL COMMENT 'sort' , PRIMARY KEY (`menu_id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Menu management' AUTO_INCREMENT=69 ROW_FORMAT=COMPACT ;
Project initiation application:
CREATE TABLE `NewTable` ( `id` int(11) NOT NULL AUTO_INCREMENT , `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `zsdw` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `principal` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `start_time` datetime NULL DEFAULT NULL , `ent_time` datetime NULL DEFAULT NULL , `majozhuban` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `sponsor` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `undertaeker` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `apply_time` datetime NULL DEFAULT NULL , `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `audit_stu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=31 ROW_FORMAT=COMPACT ;
Individual competition:
CREATE TABLE `NewTable` ( `id` int(11) NOT NULL AUTO_INCREMENT , `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `college` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `grade` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `major` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=12 ROW_FORMAT=COMPACT ;
Fund application:
CREATE TABLE `NewTable` ( `id` int(11) NOT NULL AUTO_INCREMENT , `zhuche` double NULL DEFAULT NULL , `rate` double NULL DEFAULT NULL , `train` double NULL DEFAULT NULL , `guidance` double NULL DEFAULT NULL , `haocai` double NULL DEFAULT NULL , `bonus` double NULL DEFAULT NULL , `other` double NULL DEFAULT NULL , `total` double NULL DEFAULT NULL , `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=10 ROW_FORMAT=COMPACT ;
Code structure: idea and eclipse can be run by importing directly
β
Main implementation source code:
User permission filtering:
@Bean("shiroFilter") public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) { ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); shiroFilter.setSecurityManager(securityManager); shiroFilter.setLoginUrl("/login.html"); shiroFilter.setUnauthorizedUrl("/"); Map<String, String> filterMap = new LinkedHashMap<>(); filterMap.put("/swagger/**", "anon"); filterMap.put("/v2/api-docs", "anon"); filterMap.put("/swagger-ui.html", "anon"); filterMap.put("/webjars/**", "anon"); filterMap.put("/swagger-resources/**", "anon"); filterMap.put("/statics/**", "anon"); filterMap.put("/login.html", "anon"); filterMap.put("/sys/login", "anon"); filterMap.put("/favicon.ico", "anon"); filterMap.put("/captcha.jpg", "anon"); filterMap.put("/**", "authc"); shiroFilter.setFilterChainDefinitionMap(filterMap); return shiroFilter; }
Login module authentication:
/** * Sign in */ @ResponseBody @RequestMapping(value = "/sys/login", method = RequestMethod.POST) public R login(String username, String password, String captcha) { String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY); if(!captcha.equalsIgnoreCase(kaptcha)){ return R.error("Incorrect verification code"); } try{ Subject subject = ShiroUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username, password);//md5+Jiayan subject.login(token); }catch (UnknownAccountException e) { return R.error(e.getMessage()); }catch (IncorrectCredentialsException e) { return R.error("Incorrect account or password"); }catch (LockedAccountException e) { return R.error("Account has been locked,Please contact the administrator"); }catch (AuthenticationException e) { return R.error("Account verification failed"); } return R.ok(); }
Unified exception handling:
/** * . * * * * */ package io.renren.common.exception; import io.renren.common.utils.R; import org.apache.shiro.authz.AuthorizationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DuplicateKeyException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; /** * Exception handler * * @author Mark sunlightcs@gmail.com */ @RestControllerAdvice public class RRExceptionHandler { private Logger logger = LoggerFactory.getLogger(getClass()); /** * Handle custom exceptions */ @ExceptionHandler(RRException.class) public R handleRRException(RRException e){ R r = new R(); r.put("code", e.getCode()); r.put("msg", e.getMessage()); return r; } @ExceptionHandler(DuplicateKeyException.class) public R handleDuplicateKeyException(DuplicateKeyException e){ logger.error(e.getMessage(), e); return R.error("The record already exists in the database"); } @ExceptionHandler(AuthorizationException.class) public R handleAuthorizationException(AuthorizationException e){ logger.error(e.getMessage(), e); return R.error("No permission, please contact the administrator for authorization"); } @ExceptionHandler(Exception.class) public R handleException(Exception e){ logger.error(e.getMessage(), e); return R.error(); } }
Paging query
OK, that's all for today. I'm Xiao Ao. See you next time~~
Get the complete source code:
Everyone likes, collects, pays attention to, comments and views ππ»ππ»ππ» WeChat official account gets contact ππ»ππ»ππ»
Punch in article update 187 / 100 days
Wonderful column recommendation:
Excellent practical case of Java completion project "100 sets"