[免费]微信小程序医院预约挂号管理系统(uni-app+SpringBoot后端+Vue管理端) ...

打印 上一主题 下一主题

主题 1873|帖子 1873|积分 5619

各人好,我是java1234_小锋老师,看到一个不错的微信小程序医院预约挂号管理系统(uni-app+SpringBoot后端+Vue管理端),分享下哈。
项目视频演示








【免费】微信小程序医院预约挂号管理系统(uni-app+SpringBoot后端+Vue管理端) Java毕业计划_哔哩哔哩_bilibili


项目先容

本毕业计划的内容是计划并且实现一个基于java技术的医院预约挂号管理系统。它是在Windows下,以MYSQL为数据库开发平台,java技术和Tomcat网络信息服务作为应用服务器。医院预约挂号管理系统的功能已基本实现,重要实现首页、个人中心、用户管理、专家管理、科室类型管理、科室信息管理、预约信息管理、取消信息管理、系统管理等功能的操纵系统。
论文重要从系统的分析与计划、数据库计划和系统的具体计划等几个方面来进行叙述,系统分析与计划部分重要叙述了系统的功能分析、系统的计划思路,数据库计划重要叙述了数据库的计划,系统的具体计划部分重要叙述了几个重要模块的具体计划过程。

系统展示



部分代码

  1. package cn.test.hospital.service.impl;
  2. import cn.test.hospital.common.security.AccountDetails;
  3. import cn.test.hospital.common.security.JwtTokenUtil;
  4. import cn.test.hospital.dto.param.PowerAccountRegisterParam;
  5. import cn.test.hospital.dto.param.PowerAccountStatusParam;
  6. import cn.test.hospital.dto.param.UserRegisterParam;
  7. import cn.test.hospital.entity.*;
  8. //import cn.test.hospital.hospital.entity.*;
  9. import cn.test.hospital.mapper.PowerAccountMapper;
  10. import cn.test.hospital.mapper.PowerAccountRoleRelationMapper;
  11. import cn.test.hospital.mapper.dao.PowerAccountRoleRelationDao;
  12. import cn.test.hospital.service.ILogAccountLoginService;
  13. import cn.test.hospital.service.IPowerAccountService;
  14. import cn.test.hospital.service.IUserBasicInfoService;
  15. import org.slf4j.Logger;
  16. import org.slf4j.LoggerFactory;
  17. import org.springframework.beans.factory.annotation.Value;
  18. import org.springframework.security.authentication.BadCredentialsException;
  19. import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
  20. import org.springframework.security.core.AuthenticationException;
  21. import org.springframework.security.core.context.SecurityContextHolder;
  22. import org.springframework.security.core.userdetails.UserDetails;
  23. import org.springframework.security.core.userdetails.UserDetailsService;
  24. import org.springframework.security.core.userdetails.UsernameNotFoundException;
  25. import org.springframework.security.crypto.password.PasswordEncoder;
  26. import org.springframework.stereotype.Service;
  27. import org.springframework.util.CollectionUtils;
  28. import javax.annotation.Resource;
  29. import java.util.ArrayList;
  30. import java.util.Date;
  31. import java.util.List;
  32. import java.util.Optional;
  33. /**
  34. * @author  admin
  35. */
  36. @Service
  37. public class PowerAccountServiceImpl implements IPowerAccountService {
  38.     private static final Logger LOGGER = LoggerFactory.getLogger(PowerAccountServiceImpl.class);
  39.     /**
  40.      * 一个空格字符
  41.      */
  42.     private static final String BLANK_SPACE = " ";
  43.     @Resource
  44.     private JwtTokenUtil jwtTokenUtil;
  45.     @Resource
  46.     private PasswordEncoder passwordEncoder;
  47.     @Value("${jwt.tokenHead}")
  48.     private String tokenHead;
  49.     @Resource
  50.     private UserDetailsService userDetailsService;
  51.     @Resource
  52.     private PowerAccountMapper accountMapper;
  53.     @Resource
  54.     private PowerAccountRoleRelationDao accountRoleRelationDao;
  55.     @Resource
  56.     private PowerAccountRoleRelationMapper accountRoleRelationMapper;
  57.     @Resource
  58.     private ILogAccountLoginService logAccountLoginService;
  59.     @Resource
  60.     private IUserBasicInfoService userBasicInfoService;
  61.     /**
  62.      * 获取帐号信息
  63.      *
  64.      * @param name 帐号名
  65.      * @return 帐号信息
  66.      */
  67.     @Override
  68.     public Optional<PowerAccount> getByName(String name) {
  69.         PowerAccountExample example = new PowerAccountExample();
  70.         example.createCriteria()
  71.                 .andNameEqualTo(name);
  72.         return Optional.ofNullable(accountMapper.selectByExample(example).get(0));
  73.     }
  74.     /**
  75.      * 刷新token
  76.      *
  77.      * @param oldToken 原来的token
  78.      * @return 新token
  79.      */
  80.     @Override
  81.     public String refreshToken(String oldToken) {
  82.         return jwtTokenUtil.refreshHeadToken(oldToken);
  83.     }
  84.     /**
  85.      * 判断用户名是否已使用
  86.      *
  87.      * @param name 用户名
  88.      * @return 是否存在
  89.      */
  90.     @Override
  91.     public boolean count(String name) {
  92.         PowerAccountExample example = new PowerAccountExample();
  93.         example.createCriteria()
  94.                 .andNameEqualTo(name);
  95.         return accountMapper.countByExample(example) > 0;
  96.     }
  97.     /**
  98.      * 判断用户是否存在
  99.      *
  100.      * @param id 用户编号
  101.      * @return 是否存在
  102.      */
  103.     @Override
  104.     public boolean count(Long id) {
  105.         PowerAccountExample example = new PowerAccountExample();
  106.         example.createCriteria()
  107.                 .andIdEqualTo(id);
  108.         return accountMapper.countByExample(example) > 0;
  109.     }
  110.     /**
  111.      * 注册普通用户账号
  112.      *
  113.      * @param param 用户账号注册参数(账号,密码)
  114.      * @return 是否成功
  115.      */
  116.     @Override
  117.     public boolean registerUser(UserRegisterParam param) {
  118.         PowerAccount account = new PowerAccount();
  119.         account.setName(param.getPhone());
  120.         account.setPassword(passwordEncoder.encode(param.getPassword()));
  121.         account.setStatus(1);
  122.         account.setGmtCreate(new Date());
  123.         account.setGmtModified(new Date());
  124.         if (accountMapper.insertSelective(account) > 0) {
  125.             if (userBasicInfoService.insert(param)) {
  126.                 return true;
  127.             } else {
  128.                 // 注册失败删除账号信息
  129.                 delete(param.getPhone());
  130.                 return false;
  131.             }
  132.         }
  133.         return false;
  134.     }
  135.     /**
  136.      * 管理账号注册功能
  137.      *
  138.      * @param param 账号注册参数(账号,密码)
  139.      * @return 是否成功
  140.      */
  141.     @Override
  142.     public boolean registerAdmin(PowerAccountRegisterParam param) {
  143.         PowerAccount account = new PowerAccount();
  144.         account.setName(param.getName());
  145.         account.setPassword(passwordEncoder.encode(param.getPassword()));
  146.         account.setStatus(1);
  147.         account.setGmtCreate(new Date());
  148.         account.setGmtModified(new Date());
  149.         return accountMapper.insertSelective(account) > 0;
  150.     }
  151.     /**
  152.      * 登录后返回 jwt 字符串
  153.      *
  154.      * @param name     帐号名
  155.      * @param password 密码
  156.      * @return 生成的JWT的token
  157.      */
  158.     @Override
  159.     public Optional<String> login(String name, String password) {
  160.         String jwt = null;
  161.         // 客户端加密后传递账号密码
  162.         try {
  163.             UserDetails userDetails = userDetailsService.loadUserByUsername(name);
  164.             // 密码不正确
  165.             if (!passwordEncoder.matches(password, userDetails.getPassword())) {
  166.                 LOGGER.info("user :{} login fail , wrong password .", name);
  167.                 throw new BadCredentialsException("密码不正确");
  168.             }
  169.             UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails,
  170.                     null, userDetails.getAuthorities());
  171.             SecurityContextHolder.getContext().setAuthentication(authentication);
  172.             String token = jwtTokenUtil.generateToken(userDetails);
  173.             // 这里需要记录登录时间
  174.             updateLoginTime(name);
  175.             logAccountLoginService.insert(name);
  176.             // 注意中间用空格隔开
  177.             jwt = tokenHead + BLANK_SPACE + token;
  178.         } catch (AuthenticationException e) {
  179.             LOGGER.warn("user :{} , login fail :{}", name, e.getMessage());
  180.         }
  181.         return Optional.ofNullable(jwt);
  182.     }
  183.     /**
  184.      * 检查密码是否正确
  185.      *
  186.      * @param id       账号编号
  187.      * @param password 账号密码
  188.      * @return 是否正确
  189.      */
  190.     @Override
  191.     public boolean checkPassword(Long id, String password) {
  192.         PowerAccount account = accountMapper.selectByPrimaryKey(id);
  193.         return passwordEncoder.matches(password, account.getPassword());
  194.     }
  195.     /**
  196.      * 删除账号
  197.      *
  198.      * @param name 账号名
  199.      * @return 是否成功
  200.      */
  201.     @Override
  202.     public boolean delete(String name) {
  203.         PowerAccountExample example = new PowerAccountExample();
  204.         example.createCriteria()
  205.                 .andNameEqualTo(name);
  206.         return accountMapper.deleteByExample(example) > 0;
  207.     }
  208.     /**
  209.      * 更新账号状态
  210.      *
  211.      * @param param 账号编号、账号状态(1:开启,0:关闭)
  212.      * @return 是否成功
  213.      */
  214.     @Override
  215.     public boolean updateStatus(PowerAccountStatusParam param) {
  216.         PowerAccount account = new PowerAccount();
  217.         account.setId(param.getAccountId());
  218.         account.setStatus(param.getStatus());
  219.         account.setPassword(null);
  220.         account.setGmtModified(new Date());
  221.         return accountMapper.updateByPrimaryKeySelective(account) > 0;
  222.     }
  223.     /**
  224.      * 修改用户角色关系
  225.      *
  226.      * @param accountId  帐号id
  227.      * @param roleIdList 角色id列表
  228.      * @return 成功记录
  229.      */
  230.     @Override
  231.     public int updateRole(Long accountId, List<Long> roleIdList) {
  232.         int count = roleIdList == null ? 0 : roleIdList.size();
  233.         //先删除原来的关系
  234.         PowerAccountRoleRelationExample accountRoleRelationExample = new PowerAccountRoleRelationExample();
  235.         accountRoleRelationExample.createCriteria()
  236.                 .andAccountIdEqualTo(accountId);
  237.         accountRoleRelationMapper.deleteByExample(accountRoleRelationExample);
  238.         //建立新关系
  239.         if (!CollectionUtils.isEmpty(roleIdList)) {
  240.             List<PowerAccountRoleRelation> list = new ArrayList<>();
  241.             for (Long roleId : roleIdList) {
  242.                 PowerAccountRoleRelation roleRelation = new PowerAccountRoleRelation();
  243.                 roleRelation.setAccountId(accountId);
  244.                 roleRelation.setRoleId(roleId);
  245.                 list.add(roleRelation);
  246.             }
  247.             accountRoleRelationDao.insertList(list);
  248.         }
  249.         return count;
  250.     }
  251.     /**
  252.      * 更新密码
  253.      *
  254.      * @param accountId 帐号编号
  255.      * @param password  密码
  256.      * @return 更新结果
  257.      */
  258.     @Override
  259.     public boolean updatePassword(Long accountId, String password) {
  260.         PowerAccount account = new PowerAccount();
  261.         account.setId(accountId);
  262.         account.setPassword(passwordEncoder.encode(password));
  263.         account.setGmtModified(new Date());
  264.         return accountMapper.updateByPrimaryKeySelective(account) > 0;
  265.     }
  266.     /**
  267.      * 通过用户账号名称,获取用户详情
  268.      *
  269.      * @param userName 用户账号名称
  270.      * @return 用户详情
  271.      */
  272.     @Override
  273.     public UserDetails loadUserByUserName(String userName) {
  274.         Optional<PowerAccount> accountOptional = getByName(userName);
  275.         if (accountOptional.isPresent()) {
  276.             PowerAccount account = accountOptional.get();
  277.             List<PowerResource> resourceList = listResource(account.getId());
  278.             return new AccountDetails(account, resourceList);
  279.         }
  280.         throw new UsernameNotFoundException("用户名或密码错误!");
  281.     }
  282.     /**
  283.      * 通过账号编号,获取资源列表
  284.      *
  285.      * @param accountId 账号编号
  286.      * @return 资源列表
  287.      */
  288.     @Override
  289.     public List<PowerResource> listResource(Long accountId) {
  290.         return accountRoleRelationDao.getResourceList(accountId);
  291.     }
  292.     /**
  293.      * 更新最后登录时间
  294.      *
  295.      * @param name 用户名称
  296.      */
  297.     @Override
  298.     public void updateLoginTime(String name) {
  299.         Optional<PowerAccount> accountOptional = getByName(name);
  300.         // 账号存在
  301.         if (accountOptional.isPresent()) {
  302.             PowerAccount account = accountOptional.get();
  303.             account.setPassword(null);
  304.             account.setLoginTime(new Date());
  305.             accountMapper.updateByPrimaryKeySelective(account);
  306.         }
  307.     }
  308. }
复制代码
  1. <template>
  2.   <div class="background">
  3.     <el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-position="left"
  4.              label-width="0px" class="demo-ruleForm login-container login-background">
  5.       <h3 class="title">挂号系统后台管理中心</h3>
  6.       <el-form-item prop="username">
  7.         <el-input type="text" v-model="ruleForm2.username" auto-complete="off"
  8.                   placeholder="账号" suffix-icon="el-icon-user-solid"></el-input>
  9.       </el-form-item>
  10.       <el-form-item prop="password">
  11.         <el-input type="password" v-model="ruleForm2.password" auto-complete="off"
  12.                   placeholder="密码" suffix-icon="el-icon-lock"></el-input>
  13.       </el-form-item>
  14.       <el-checkbox v-model="checked" checked class="remember">记住密码</el-checkbox>
  15.       <el-form-item style="width:100%;">
  16.         <el-button type="primary" style="width:100%;" @click="handleSubmit2" :loading="loading">登录</el-button>
  17.       
  18.       </el-form-item>
  19.     </el-form>
  20.   </div>
  21. </template>
  22. <script>
  23.   import {getCookie, setCookie} from "@/utils/cookies";
  24.   import {getPermission} from "@/permission";
  25.   import {getToken} from "@/utils/auth";
  26.   export default {
  27.     name: "login",
  28.     data(){
  29.       return{
  30.         loading: false,
  31.         ruleForm2: {
  32.           username: '',
  33.           password: ''
  34.         },
  35.         rules2: {
  36.           username: [{ required: true, message: '请输入账号',trigger: 'blur'}],
  37.           password: [{required: true,message: '请输入密码',trigger: 'blur'}]
  38.         },
  39.         checked: false,
  40.         redirect: undefined
  41.       }
  42.     },
  43.     watch: {
  44.       $route: {
  45.         handler: function(route) {
  46.           this.redirect = route.query && route.query.redirect
  47.         },
  48.         immediate: true
  49.       }
  50.     },
  51.     methods: {
  52.       handleSubmit2(ev) {
  53.         var _this = this;
  54.         _this.$refs.ruleForm2.validate((valid) => {
  55.           if (valid) {
  56.             _this.loading = true;
  57.             // 实现登录
  58.               this.$store.dispatch('Login', this.ruleForm2).then(() => {
  59.               if (this.checked) {
  60.                 setCookie("username",this.ruleForm2.username,15);
  61.                 setCookie("password",this.ruleForm2.password,15);
  62.               }
  63.               _this.$router.push({path: this.redirect || '/home'});
  64.               _this.loading = false
  65.             }).catch(() => {
  66.               _this.loading = false;
  67.               _this.$alert('用户名或密码错误!', '提示信息', {
  68.                 confirmButtonText: '确定'
  69.               });
  70.             })
  71.           } else {
  72.             console.log('error submit!!');
  73.             return false;
  74.           }
  75.         });
  76.       }
  77.     },
  78.     created() {
  79.       this.ruleForm2.username = getCookie('username');
  80.       this.ruleForm2.password = getCookie('password');
  81.       if(this.ruleForm2.username === undefined||this.ruleForm2.username==null||this.ruleForm2.username===''){
  82.         this.ruleForm2.username = 'admin';
  83.       }
  84.       if(this.ruleForm2.password === undefined||this.ruleForm2.password==null){
  85.         this.ruleForm2.password = '';
  86.       }
  87.     }
  88.   }
  89. </script>
  90. <style scoped>
  91.   .background{
  92.     width: 100%;
  93.     height: 100%;
  94.     background: url("../.././assets/background.jpg") no-repeat;
  95.     background-size: 100% 100%;
  96.     position: fixed;
  97.     top: 0px;
  98.     left: 0px;
  99.   }
  100.   .login-container{
  101.     -webkit-border-radius: 5px;
  102.     border-radius: 5px;
  103.     -moz-border-radius: 5px;
  104.     background-clip: padding-box;
  105.     margin: 180px auto;
  106.     width: 350px;
  107.     padding: 35px 35px 15px;
  108.     background: #BED2F5;
  109.     /*border: 1px solid #eaeaea;*/
  110.     box-shadow: 0 0 25px #A7BBD4;
  111.   }
  112.   label.el-checkbox.remember {
  113.     margin: 0px 0px 30px 0px;
  114.   }
  115.   .title{
  116.     color: #ffffff;
  117.   }
  118. </style>
复制代码
源码下载

链接:https://pan.baidu.com/s/1zn70zMBz6Mmf_Kvg0O7avA
提取码:1234


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

半亩花草

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表