主要功能设计:
用户、区域、物质类型、物质详情、物质申请和审核以及我的申请和通知公告以及灵活控制菜单权限
主要技术实现:spring、 springmvc、 springboot、springboot security权限框架 mybatis 、 jquery 、 md5 、bootstarp.js tomcat、器、拦截器等
具体功能模块:用户模块、角色模块、菜单模块、部门模块以及灵活的权限控制,可控制到页面或按钮,满足绝大部分的权限需求 业务模块功能:区域管理、对不同区域的进行管理以及物质发放等、物质类型管理、物质详情管理、物质申请管理、物质审核管理、我的物质申请管理、以及系统通知公告查看等具体功能模块、以及修改密码退出等。
功能截图如下:
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;
@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);
//保存到shiro session
ShiroUtils.setSessionAttribute(Constants.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.error("验证码不正确");
}
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("账号或密码不正确");
}catch (LockedAccountException e) {
return R.error("账号已被锁定,请联系管理员");
}catch (AuthenticationException e) {
return R.error("账户验证失败");
}
return R.ok();
}
@RequestMapping(value = "logout", method = RequestMethod.GET)
public String logout() {
ShiroUtils.logout();
return "redirect:login.html";
}
}
用户首页超级管理员页面功能:
用户管理:每个模块对应的CRUD功能都是完善的
角色灵活设置权限:
菜单管理:
区域管理:
抗疫物质类型管理:
抗疫物质详情管理;
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","未审核");
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("未审核");
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();
}
}
用户申请抗疫物质:
管理员审核:
普通用户权限;
数据集设计ER图:
CREATE TABLE `NewTable` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT ,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名' ,
`password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码' ,
`salt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '盐' ,
`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 '手机号' ,
`status` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0:禁用 1:正常' ,
`dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID' ,
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间' ,
PRIMARY KEY (`user_id`),
UNIQUE INDEX `username` (`username`) USING BTREE
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='系统用户'
AUTO_INCREMENT=3
ROW_FORMAT=COMPACT
;
到此这篇关于抗疫物质信息管理系统基于JAVA SSM springboot实现的文章就介绍到这了,更多相关信息管理系统内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!