Main function design:

User, area, substance type, substance details, substance application and audit as well as my application and notice announcement and flexible control menu permissions

Source code to obtain: Q810569458

                                                           

Main technical implementation: Spring, SpringMVC, SpringBoot, SpringBoot Security authority framework Mybatis, jquery, MD5, Bootstarp.js Tomcat, interceptor, etc

Specific function modules: user module, role module, menu module, department module and flexible permission control, which can control pages or buttons to meet most of the permission requirements

Business module functions: area management, management of different areas and material delivery, material type management, material details management, material application management, material audit management, my material application management, and system notice announcement view and other specific function modules, as well as changing the password exit, etc.

The screenshots are as follows:

/** * . * * * * */ package io.renren.modules.sys.controller; import com.google.code.kaptcha.Constants; import com.google.code.kaptcha.Producer; import io.renren.common.utils.R; import io.renren.modules.sys.shiro.ShiroUtils; import org.apache.shiro.authc.*; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.IOException; ** @author Mark s.com */ @controller public class SysLoginController {@autowired private Producer Producer;  @RequestMapping("captcha.jpg") public void captcha(HttpServletResponse response)throws IOException { response.setHeader("Cache-Control", "no-store, no-cache"); response.setContentType("image/jpeg"); String text = producer.createText(); BufferedImage image = producer.createImage(text); / / save the shiro session ShiroUtils. SetSessionAttribute (the KAPTCHA_SESSION_KEY, text); ServletOutputStream out = response.getOutputStream(); ImageIO.write(image, "jpg", out); } /** * @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.ror (" Captcha is not correct "); } try{ Subject subject = ShiroUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username, password); //md5+Jiayan subject.login(token); }catch (UnknownAccountException e) { return R.error(e.getMessage()); } the catch (IncorrectCredentialsException e) {return R.e rror (" account or password is not correct "); }catch (LockedAccountException e) {return r.ror (" Account has been locked, please contact your administrator "); }catch (AuthenticationException e) {return r.ror (" account failed to authenticate "); } return R.ok(); } @requestMapping (value = "logout", method = RequestMethod.GET) public String logout() { ShiroUtils.logout(); return "redirect:login.html"; }}Copy the code

User Home Page Super administrator functions:

User management: CRUD functions corresponding to each module are complete

Flexible role setting permissions:

Menu Management:

Regional management:

Type management of anti-epidemic substances:

Detailed management of anti-epidemic substances;

package io.renren.modules.sys.controller; import io.renren.common.utils.PageUtils; import io.renren.common.utils.R; import io.renren.modules.sys.entity.MatterApply; import io.renren.modules.sys.service.MatterApplyService; import io.renren.modules.sys.service.impl.MatterApplyServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Arrays; import java.util.Date; import java.util.Map; @RestController @RequestMapping("/sys/matterApply") public class MatterApplyController extends AbstractController { @Autowired private MatterApplyService MatterApplyService; @Autowired MatterApplyServiceImpl MatterApplyServiceImpe; @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = MatterApplyService.queryPage(params); return R.ok().put("page", page); } @RequestMapping("/AuditList") public R AuditList(@RequestParam Map<String, Object> params){params.put("applyStu"," unaudited "); PageUtils page = MatterApplyService.queryPage(params); return R.ok().put("page", page); } @RequestMapping("/listByUser") public R listByUser(@RequestParam Map<String, Object> params){ params.put("applyUserId",String.valueOf(getUserId())); PageUtils page = MatterApplyService.queryPage(params); return R.ok().put("page", page); } @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ MatterApply matterApply = MatterApplyService.getById(id); return R.ok().put("matterApply", matterApply); } @RequestMapping("/save") public R save(@RequestBody MatterApply matterApply){ matterApply.setApplyTime(new Date()); matterApply.setApplyUserId(getUserId()); Matterapply.setapplystu (" not audited "); MatterApplyService.save(matterApply); return R.ok(); } @RequestMapping("/update") public R update(@RequestBody MatterApply matterApply){ MatterApplyService.updateById(matterApply); return R.ok(); } @RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ MatterApplyService.removeByIds(Arrays.asList(ids)); return R.ok(); }}Copy the code

User’s application for anti-epidemic substances:

Administrator review:

Ordinary user rights;

Data set design ER diagram:

CREATE TABLE `NewTable` ( `user_id` bigint(20) NOT NULL AUTO_INCREMENT , 'username' varchar(50) CHARACTER SET UTf8MB4 COLLATE UTf8MB4_general_ci NOT NULL COMMENT 'username', 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 ' 'mobile' varchar(100) CHARACTER SET UTf8MB4 COLLATE UTf8MB4_general_ci NULL DEFAULT NULL COMMENT 'cellphone', 'status' tinyint(4) NULL DEFAULT NULL COMMENT' Dept_id bigint(20) NULL DEFAULT NULL COMMENT 'department ID',' create_time 'datetime NULL DEFAULT NULL COMMENT' create 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;Copy the code

Pay attention to the blogger one health three yo