系统介绍
基于SpringBoot+Vue实现的药品管理系统采用前后端分离的架构方式,系统实现了用户登录、数据中心、药库管理、药房管理、物资管理、挂号管理、系统管理、基础设置等功能模块。
技术选型
开发工具:idea2020.3+Webstorm2020.3
运行环境:jdk1.8+maven3.6.0+MySQL5.7+nodejs14.21.3
服务端技术:Springboot+Mybatis-Plus+SpringSecurity+Fastjson
前端技术:html+css+Vue+axios+Element-UI+echarts
成果展示
用户登录
image-20250117171349594
数据中心
image-20250117171550993
药库管理->药库库存
image-20250117171759876
药库管理->药库操作
image-20250117171729733
药房管理->药房库存
image-20250117171812715
物资管理->物资列表
image-20250117171841454
挂号管理->挂号列表
image-20250117171904583
系统管理->账号管理
image-20250117171918491
系统管理->角色设置
image-20250117172007442
系统管理->权限列表
image-20250117172015601
系统管理->登录日志
image-20250117172025297
系统管理->数据库备份
image-20250117172036288
基础设置->药品管理
image-20250117172048141
源码展示
@Api(tags="用户相关控制类")
@RestController
@RequestMapping("/user")
public class UserCtrl extends BaseCtrl {
@Autowired
private UserService userService;
@Autowired
private UserLoginLogService userLoginLogService;
@Autowired
private RoleService roleService;
/**
* 前台每次请求(如果VUEX没有)都需要获取最新的用户信息 包含权限
* @param request
* @param response
* @return
*/
@ApiOperation(value = "获取最新的用户信息 包含权限")
@RequestMapping(value="/info/", method= RequestMethod.POST)
@ResponseBody
public User info(HttpServletRequest request, HttpServletResponse response) {
//获取当前登录用户
User user = UserUtil.getCurrentPrincipal();
user.setRoles(new HashSet<>(roleService.getRolesByUserId(user.getId())));
return user;
}
@ApiOperation(value = "根据ID获取用户")
@ApiImplicitParam(dataType="int", example="1", required=true, name="id", allowEmptyValue=false, value="用户ID")
@GetMapping(value="/get/")
@ResponseBody
public User get() {
//根据用户ID获取用户对象
User user = userService.getById(UserUtil.getCurrentPrincipal().getId());
return user;
}
/**
* @param userRequest
* @param request
* @param response
* @return
*/
@ApiOperation(value = "保存用户对象")
@RequestMapping(value="/save/", method=RequestMethod.POST)
@ResponseBody
public APIResult<?> save(@RequestBody UserRequest userRequest, HttpServletRequest request, HttpServletResponse response) {
//保存用户对象
User user = userService.getById(userRequest.getId());
user = UserRequest.parseUserRequest(userRequest, user);
userService.saveUserAndRoles(user, userRequest.getRoleIds());
return APIResult.newSuccessResult();
}
@ApiOperation(value = "根据ID停用账户")
@ApiImplicitParam(dataType="int", example="1", required=true, name="id", allowEmptyValue=false, value="用户ID")
@GetMapping(value="/close/{id:[0-9]+}")
@ResponseBody
public String close(@PathVariable(name="id") Integer id, HttpServletRequest request, HttpServletResponse response) {
User user = userService.getById(id);
User newUser = new User();
newUser.setId(user.getId());
newUser.setIsEnable(false);
userService.updateById(newUser);
return "";
}
@ApiOperation(value = "根据ID启用账户")
@ApiImplicitParam(dataType="int", example="1", required=true, name="id", allowEmptyValue=false, value="用户ID")
@GetMapping(value="/open/{id:[0-9]+}")
@ResponseBody
public String open(@PathVariable(name="id") Integer id, HttpServletRequest request, HttpServletResponse response) {
User user = userService.getById(id);
User newUser = new User();
newUser.setId(user.getId());
newUser.setIsEnable(true);
userService.updateById(newUser);
return "";
}
@ApiOperation(value = "根据ID加载用户详情")
@ApiImplicitParam(dataType="int", example="1", required=true, name="id", allowEmptyValue=false, value="用户ID")
@GetMapping(value="/detail/{id:[0-9]+}")
@ResponseBody
public UserFromResponse loadDateil(@PathVariable(name="id") Integer id, HttpServletRequest request, HttpServletResponse response) {
//获取用户信息
User user = userService.getById(id);
//将用户信息放入reponse中
UserResponse userResponse = new UserResponse(user);
List<Role> userRoles = roleService.getRolesByUserId(user.getId());
userResponse.setRoleId(userRoles.size() == 0 ? null : userRoles.get(0).getId());
UserFromResponse userFromResponse = new UserFromResponse();
//将用户reponse放入userFromReponse中
userFromResponse.setUser(userResponse);
//获取全部角色集合放入userFromReponse中
List<Role> roles = roleService.list();
// //放入reponse对象
userFromResponse.setRoles(roles);
return userFromResponse;
}
......
}
账号地址及其他说明
1、地址说明
登录页:http://localhost:8889
2、账号说明
管理员:admin/123456