├── hospital-web ├── static │ ├── .gitkeep │ └── favicon.ico ├── theme │ ├── form-item.css │ ├── menu-item.css │ ├── submenu.css │ ├── tab-pane.css │ ├── breadcrumb-item.css │ ├── button-group.css │ ├── checkbox-button.css │ ├── checkbox-group.css │ ├── collapse-item.css │ ├── dropdown-item.css │ ├── dropdown-menu.css │ ├── infinite-scroll.css │ ├── infiniteScroll.css │ ├── menu-item-group.css │ ├── fonts │ │ ├── element-icons.ttf │ │ └── element-icons.woff │ ├── element-variables.css │ ├── aside.css │ ├── steps.css │ ├── container.css │ ├── reset.css │ ├── spinner.css │ ├── radio-group.css │ ├── footer.css │ ├── header.css │ ├── timeline.css │ ├── main.css │ └── popconfirm.css ├── src │ ├── components │ │ ├── index.js │ │ └── NavMenu.vue │ ├── assets │ │ └── bg.jpg │ ├── App.vue │ ├── utils │ │ ├── enum.js │ │ └── request.js │ ├── views │ │ ├── 404.vue │ │ ├── home │ │ │ └── index.vue │ │ ├── selfHelp │ │ │ ├── register.vue │ │ │ ├── record.vue │ │ │ └── pay.vue │ │ ├── login.vue │ │ ├── user │ │ │ ├── upPassword.vue │ │ │ └── info.vue │ │ └── index.vue │ ├── main.js │ └── router │ │ └── index.js ├── .eslintignore ├── config │ ├── prod.env.js │ ├── test.env.js │ ├── dev.env.js │ └── index.js ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── .babelrc ├── README.md ├── index.html ├── .eslintrc.js └── package.json ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ ├── maven-wrapper.properties │ └── MavenWrapperDownloader.java ├── src └── main │ ├── resources │ └── application.properties │ └── java │ └── com │ └── gak │ └── hospital │ ├── HospitalApplication.java │ ├── entity │ ├── Dept.java │ ├── Medical.java │ ├── Drugstore.java │ ├── Drug.java │ ├── Checklist.java │ ├── Prescribe.java │ ├── User.java │ ├── MedicalRecord.java │ └── BillInfo.java │ ├── repository │ ├── DrugstoreRepository.java │ ├── DrugRepository.java │ ├── DeptRepository.java │ ├── MedicalRepository.java │ ├── ChecklistRepository.java │ ├── PrescribeRepository.java │ ├── BillInfoRepository.java │ ├── UserRepository.java │ └── MedicalRecordRepository.java │ ├── service │ ├── DrugstoreService.java │ ├── DrugService.java │ ├── MedicalService.java │ ├── DeptService.java │ ├── PrescribeService.java │ ├── ChecklistService.java │ ├── UserService.java │ ├── MedicalRecordService.java │ └── impl │ │ ├── DeptServiceImpl.java │ │ ├── MedicalServiceImpl.java │ │ ├── DrugServiceImpl.java │ │ ├── CustomUserDetailsService.java │ │ ├── DrugstoreServiceImpl.java │ │ ├── PrescribeServiceImpl.java │ │ ├── ChecklistServiceImpl.java │ │ └── MedicalRecordServiceImpl.java │ ├── utils │ ├── DateUtils.java │ ├── ResultUtils.java │ ├── RoleUtils.java │ ├── TokenUtils.java │ └── CacheUtils.java │ ├── config │ ├── AuthTokenConfigurer.java │ └── SecurityConfiguration.java │ ├── controller │ ├── LoginController.java │ ├── TechnicalController.java │ ├── AdminController.java │ ├── PharmacistController.java │ ├── UserController.java │ └── DoctorController.java │ └── filter │ └── AuthTokenFilter.java ├── .gitignore └── pom.xml /hospital-web/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/form-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/menu-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/submenu.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/tab-pane.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/breadcrumb-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/button-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/checkbox-button.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/checkbox-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/collapse-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/dropdown-item.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/dropdown-menu.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/infinite-scroll.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/infiniteScroll.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/theme/menu-item-group.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hospital-web/src/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as NavMenu } from './NavMenu.vue' -------------------------------------------------------------------------------- /hospital-web/.eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | /test/unit/coverage/ 6 | -------------------------------------------------------------------------------- /hospital-web/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengxin930926134/hospital/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /hospital-web/src/assets/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengxin930926134/hospital/HEAD/hospital-web/src/assets/bg.jpg -------------------------------------------------------------------------------- /hospital-web/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengxin930926134/hospital/HEAD/hospital-web/static/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengxin930926134/hospital/HEAD/src/main/resources/application.properties -------------------------------------------------------------------------------- /hospital-web/theme/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengxin930926134/hospital/HEAD/hospital-web/theme/fonts/element-icons.ttf -------------------------------------------------------------------------------- /hospital-web/theme/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengxin930926134/hospital/HEAD/hospital-web/theme/fonts/element-icons.woff -------------------------------------------------------------------------------- /hospital-web/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /hospital-web/config/test.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const devEnv = require('./dev.env') 4 | 5 | module.exports = merge(devEnv, { 6 | NODE_ENV: '"testing"' 7 | }) 8 | -------------------------------------------------------------------------------- /hospital-web/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /hospital-web/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"', 7 | API: '"/api"' 8 | }) 9 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /hospital-web/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | /test/unit/coverage/ 8 | 9 | # Editor directories and files 10 | .idea 11 | .vscode 12 | *.suo 13 | *.ntvs* 14 | *.njsproj 15 | *.sln 16 | -------------------------------------------------------------------------------- /hospital-web/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /hospital-web/src/utils/enum.js: -------------------------------------------------------------------------------- 1 | export const roleEnum = [ 2 | { key: 'ROLE_ADMIN', name: '管理员', type: 'danger' }, 3 | { key: 'ROLE_DOCTOR', name: '医生', type: 'warning' }, 4 | { key: 'ROLE_TECHNICAL', name: '技师', type: 'info' }, 5 | { key: 'ROLE_PHARMACIST', name: '药师', type: 'success' }, 6 | { key: 'ROLE_USER', name: '用户', type: '' }, 7 | ] -------------------------------------------------------------------------------- /hospital-web/src/views/404.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/HospitalApplication.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HospitalApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HospitalApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/Dept.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import javax.persistence.*; 5 | 6 | /** 7 | * 科室 8 | */ 9 | @Entity 10 | @Data 11 | @Table(name="dept") 12 | public class Dept implements java.io.Serializable { 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.IDENTITY) 15 | private int deptId; 16 | private String deptName; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/Medical.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import javax.persistence.*; 5 | 6 | /** 7 | * 医技 8 | */ 9 | @Entity 10 | @Data 11 | @Table(name="medical") 12 | public class Medical implements java.io.Serializable { 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.IDENTITY) 15 | private int medicalId; 16 | private String medicalName; 17 | private float medicalPrice; 18 | } 19 | -------------------------------------------------------------------------------- /hospital-web/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/Drugstore.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | 5 | import javax.persistence.*; 6 | 7 | /** 8 | * 药房 9 | */ 10 | @Entity 11 | @Data 12 | @Table(name="drugstore") 13 | public class Drugstore { 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) 16 | private int id; 17 | private int drugId; 18 | private String drugName; 19 | private int number; 20 | @Transient 21 | private Drug drug; 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/DrugstoreRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.Drugstore; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | public interface DrugstoreRepository extends JpaRepository { 9 | Page findDrugstoreByDrugNameLikeAndNumberNot(String drugName, int number, Pageable pageable); 10 | 11 | Drugstore findDrugstoreByDrugId(int drugId); 12 | } 13 | -------------------------------------------------------------------------------- /hospital-web/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import ElementUI from 'element-ui' 7 | import 'element-ui/lib/theme-chalk/index.css' 8 | import Api from './api/index.js' 9 | 10 | Vue.prototype.$api = Api 11 | Vue.use(ElementUI) 12 | Vue.config.productionTip = false 13 | 14 | /* eslint-disable no-new */ 15 | new Vue({ 16 | el: '#app', 17 | router, 18 | render: h => h(App) 19 | }) 20 | -------------------------------------------------------------------------------- /hospital-web/README.md: -------------------------------------------------------------------------------- 1 | # hospital-ui 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | 20 | # run unit tests 21 | npm run unit 22 | 23 | # run all tests 24 | npm test 25 | ``` 26 | 27 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 28 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/DrugstoreService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.Drugstore; 4 | import org.springframework.data.domain.Page; 5 | 6 | public interface DrugstoreService { 7 | /** 8 | * 分页模糊查询 9 | * @param drugName name 10 | * @param pageNumber 页 11 | * @param pageSize 一页多少条 12 | * @return page 13 | */ 14 | Page getDrugstoreAllByPageAndDrugName(String drugName, int pageNumber, int pageSize); 15 | 16 | /** 17 | * 添加or更新 管理员 18 | * @param drugstore drugstore 19 | * @return boolean 20 | */ 21 | boolean saveOrUpdate(Drugstore drugstore); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/DrugRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.Drug; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | public interface DrugRepository extends JpaRepository { 12 | 13 | Page findDrugByNameLike(String name, Pageable pageable); 14 | 15 | @Transactional 16 | void deleteDrugByIdIn(List ids); 17 | 18 | Drug findDrugById(int id); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/DeptRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.Dept; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.transaction.annotation.Transactional; 8 | import java.util.List; 9 | 10 | public interface DeptRepository extends JpaRepository { 11 | 12 | Page findDeptByDeptNameLike(String deptName, Pageable pageable); 13 | 14 | @Transactional 15 | void deleteDeptByDeptIdIn(List ids); 16 | 17 | Dept findDeptByDeptId(int deptId); 18 | } 19 | -------------------------------------------------------------------------------- /hospital-web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= webpackConfig.name %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/Drug.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import javax.persistence.*; 5 | import java.util.Date; 6 | 7 | /** 8 | * 药品 9 | */ 10 | @Entity 11 | @Data 12 | @Table(name="drug") 13 | public class Drug implements java.io.Serializable { 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) 16 | private int id; 17 | private String name; 18 | //批号 19 | private String batchNumber; 20 | private float price; 21 | //类别 处方药和非处方药 22 | private String category; 23 | //生产日期 24 | private Date manufactureDate; 25 | //保质期(月) 26 | private int dueMonth; 27 | @Transient 28 | private String manufactureDateName; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/utils/DateUtils.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.utils; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | public class DateUtils { 7 | 8 | private static final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); 9 | 10 | private static final SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 11 | 12 | /** 13 | * date转String 14 | * @param date date 15 | * @return string 16 | */ 17 | public static String formatYMD(Date date) { 18 | return df.format(date); 19 | } 20 | 21 | public static String formatYMDHMS(Date date) { 22 | return df2.format(date); 23 | } 24 | 25 | private DateUtils(){} 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/MedicalRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.Medical; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | public interface MedicalRepository extends JpaRepository { 12 | 13 | Page findMedicalByMedicalNameLike(String medicalName, Pageable pageable); 14 | 15 | @Transactional 16 | void deleteMedicalByMedicalIdIn(List ids); 17 | 18 | Medical findMedicalByMedicalId(int id); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/DrugService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.Drug; 4 | import org.springframework.data.domain.Page; 5 | 6 | import java.util.List; 7 | 8 | public interface DrugService { 9 | 10 | /** 11 | * 添加or更新 管理员 12 | * @param drug drug 13 | * @return boolean 14 | */ 15 | boolean saveOrUpdate(Drug drug); 16 | 17 | /** 18 | * 分页模糊查询 19 | * @param drugName drugName 20 | * @param pageNumber 页 21 | * @param pageSize 一页多少条 22 | * @return page 23 | */ 24 | Page getDrugAllByPageAndDrugName(String drugName, int pageNumber, int pageSize); 25 | 26 | /** 27 | * 根据ids删除 (管理员) 28 | * @param ids ids 29 | * @return boolean 30 | */ 31 | boolean delDrugByIds(List ids); 32 | 33 | List getAll(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/MedicalService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.Medical; 4 | import org.springframework.data.domain.Page; 5 | import java.util.List; 6 | 7 | public interface MedicalService { 8 | 9 | /** 10 | * 添加or更新 管理员 11 | * @param medical medical 12 | * @return boolean 13 | */ 14 | boolean saveOrUpdate(Medical medical); 15 | 16 | /** 17 | * 分页模糊查询 18 | * @param medicalName medicalName 19 | * @param pageNumber 页 20 | * @param pageSize 一页多少条 21 | * @return page 22 | */ 23 | Page getMedicalAllByPageAndMedicalName(String medicalName, int pageNumber, int pageSize); 24 | 25 | /** 26 | * 根据ids删除 (管理员) 27 | * @param ids ids 28 | * @return boolean 29 | */ 30 | boolean delMedicalByIds(List ids); 31 | 32 | List getAll(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/Checklist.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import org.springframework.data.annotation.CreatedDate; 5 | import javax.persistence.*; 6 | import java.util.Date; 7 | 8 | /** 9 | * 检查单 10 | */ 11 | @Entity 12 | @Data 13 | @Table(name="checklist") 14 | public class Checklist implements java.io.Serializable { 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) 17 | private int id; 18 | //医技id 19 | private int medicalId; 20 | //就诊号 21 | private int visitNumber; 22 | private String userName; 23 | private int doctorId; 24 | private int medicalNumber; 25 | //0.待付款 1.待使用 2.已使用 当已付款在状态上加 当使用后在总状态上减 26 | private int status; 27 | @CreatedDate 28 | private Date createDate; 29 | @Transient 30 | private String doctorName; 31 | @Transient 32 | private String medicalName; 33 | } 34 | -------------------------------------------------------------------------------- /hospital-web/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parserOptions: { 6 | parser: 'babel-eslint' 7 | }, 8 | env: { 9 | browser: true, 10 | }, 11 | extends: [ 12 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention 13 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 14 | 'plugin:vue/essential', 15 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 16 | 'standard' 17 | ], 18 | // required to lint *.vue files 19 | plugins: [ 20 | 'vue' 21 | ], 22 | // add your custom rules here 23 | rules: { 24 | // allow async-await 25 | 'generator-star-spacing': 'off', 26 | // allow debugger during development 27 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/DeptService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.Dept; 4 | import org.springframework.data.domain.Page; 5 | import java.util.List; 6 | 7 | public interface DeptService { 8 | 9 | /** 10 | * 分页模糊查询 11 | * @param deptName name 12 | * @param pageNumber 页 13 | * @param pageSize 一页多少条 14 | * @return page 15 | */ 16 | Page getDeptAllByPageAndDeptName(String deptName, int pageNumber, int pageSize); 17 | 18 | /** 19 | * 添加or更新 (管理员) 20 | * @param dept dept 21 | * @return boolean 22 | */ 23 | boolean addOrUpdateDept(Dept dept); 24 | 25 | /** 26 | * 根据ids删除 (管理员) 27 | * @param ids ids 28 | * @return boolean 29 | */ 30 | boolean delDeptByIds(List ids); 31 | 32 | /** 33 | * 获取所有部门 34 | * @return list 35 | */ 36 | List getAll(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/Prescribe.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import org.springframework.data.annotation.CreatedDate; 5 | import javax.persistence.*; 6 | import java.util.Date; 7 | 8 | /** 9 | * 处方 10 | */ 11 | @Entity 12 | @Data 13 | @Table(name="prescribe") 14 | public class Prescribe implements java.io.Serializable { 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) 17 | private int id; 18 | //药品id 19 | private int drugId; 20 | //就诊号 21 | private int visitNumber; 22 | private String userName; 23 | //医生 24 | private int doctorId; 25 | //药品数量 26 | private int drugNumber; 27 | //0.待付款 1.待使用 2.已使用 当已付款在状态上加 当使用后在总状态上减 28 | private int status; 29 | @CreatedDate 30 | private Date createDate; 31 | @Transient 32 | private String drugName; 33 | @Transient 34 | private float price; 35 | @Transient 36 | private String doctorName; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/ChecklistRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.Checklist; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.util.List; 12 | 13 | public interface ChecklistRepository extends JpaRepository { 14 | Checklist findChecklistById(int id); 15 | 16 | @Modifying 17 | @Transactional 18 | @Query("update Checklist c SET " + 19 | "c.status = :#{#status} " + 20 | "where c.id in (:#{#ids})") 21 | int updateStatus(List ids, int status); 22 | 23 | Page findChecklistByUserNameLike(String userName, Pageable pageable); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/PrescribeRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.Prescribe; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.util.List; 12 | 13 | public interface PrescribeRepository extends JpaRepository { 14 | Prescribe findPrescribeById(int id); 15 | 16 | @Modifying 17 | @Transactional 18 | @Query("update Prescribe p SET " + 19 | "p.status = :#{#status} " + 20 | "where p.id in (:#{#ids})") 21 | int updateStatus(List ids, int status); 22 | 23 | Page findPrescribeByUserNameLike(String userName, Pageable pageable); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/BillInfoRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.BillInfo; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.jpa.repository.Query; 6 | 7 | import java.util.List; 8 | 9 | public interface BillInfoRepository extends JpaRepository { 10 | 11 | @Query("SELECT new com.gak.hospital.entity.BillInfo(p, d) " + 12 | "FROM Prescribe p LEFT JOIN Drug d ON p.drugId = d.id " + 13 | "WHERE p.status = :#{#status} AND p.id in (:#{#ids})") 14 | List findPrescribeByIdInAndStatus(List ids, int status); 15 | 16 | @Query("SELECT new com.gak.hospital.entity.BillInfo(c, m) " + 17 | "FROM Checklist c LEFT JOIN Medical m ON c.medicalId = m.medicalId " + 18 | "WHERE c.status = :#{#status} AND c.id in (:#{#ids})") 19 | List findChecklistByIdInAndStatus(List ids, int status); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/utils/ResultUtils.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.utils; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.springframework.data.domain.Page; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class ResultUtils { 10 | 11 | public static JSONObject pageToJson(Page page) { 12 | JSONObject object = getJson(); 13 | object.put("totalElements", page.getTotalElements()); 14 | object.put("data", page.getContent()); 15 | return object; 16 | } 17 | 18 | /** 19 | * 实体转json分页数据 20 | */ 21 | public static JSONObject entityToPageJson(T t) { 22 | JSONObject object = getJson(); 23 | List list = new ArrayList<>(); 24 | list.add(t); 25 | object.put("totalElements", 1); 26 | object.put("data", list); 27 | return object; 28 | } 29 | 30 | private static JSONObject getJson() { 31 | return new JSONObject(); 32 | } 33 | 34 | private ResultUtils() {} 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import javax.persistence.*; 5 | import java.util.Date; 6 | 7 | @Entity 8 | @Data 9 | @Table(name="user") 10 | public class User implements java.io.Serializable { 11 | @Id 12 | @GeneratedValue(strategy = GenerationType.IDENTITY) 13 | private int id; 14 | private String username; 15 | private String password; 16 | private String name; 17 | // 1男 2女 18 | private int sex; 19 | private String phone; 20 | //生日 21 | private Date birthDate; 22 | //科室 23 | private Integer deptId; 24 | private String role; 25 | //非一个到数据库表的字段的映射,ORM框架将忽略该属性 26 | @Transient 27 | private String newPassword; 28 | @Transient 29 | private String deptName; 30 | @Transient 31 | private String[] roleList; 32 | @Transient 33 | private String sexName; 34 | @Transient 35 | private String birthDateName; 36 | 37 | public User(int id, String name) { 38 | this.id = id; 39 | this.name = name; 40 | } 41 | 42 | public User() {} 43 | } -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/PrescribeService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.Prescribe; 4 | import org.springframework.data.domain.Page; 5 | import java.util.List; 6 | 7 | public interface PrescribeService { 8 | /** 9 | * 添加or更新 10 | * @param prescribe prescribe 11 | * @return boolean 12 | */ 13 | boolean addOrUpdate(Prescribe prescribe); 14 | 15 | /** 16 | * 根据id获取处方 17 | * @param id id 18 | * @return Prescribe 19 | */ 20 | Prescribe getPrescribeById(int id); 21 | 22 | /** 23 | * 删除 24 | * @param id id 25 | * @return boolean 26 | */ 27 | boolean delPrescribeById(int id); 28 | 29 | /** 30 | * 更新处方状态 31 | */ 32 | boolean updateStatusByIds(List prescribeIds, int status); 33 | 34 | /** 35 | * 分页模糊查询 36 | * @param userName userName 37 | * @param pageNumber 页 38 | * @param pageSize 一页多少条 39 | * @return page 40 | */ 41 | Page getPrescribeAllByPageAndUserName(String userName, int pageNumber, int pageSize); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/ChecklistService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.Checklist; 4 | import org.springframework.data.domain.Page; 5 | 6 | import java.util.List; 7 | 8 | public interface ChecklistService { 9 | /** 10 | * 添加or更新 11 | * @param checklist checklist 12 | * @return boolean 13 | */ 14 | boolean addOrUpdate(Checklist checklist); 15 | 16 | /** 17 | * 根据id获取检查单 18 | * @param id id 19 | * @return Checklist 20 | */ 21 | Checklist getChecklistById(int id); 22 | 23 | /** 24 | * 删除 25 | * @param id id 26 | * @return boolean 27 | */ 28 | boolean delChecklistById(int id); 29 | 30 | /** 31 | * 更新状态 32 | */ 33 | boolean updateStatusByIds(List checklistIds, int status); 34 | 35 | /** 36 | * 分页模糊查询 37 | * @param userName userName 38 | * @param pageNumber 页 39 | * @param pageSize 一页多少条 40 | * @return page 41 | */ 42 | Page getChecklistAllByPageAndUserName(String userName, int pageNumber, int pageSize); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/config/AuthTokenConfigurer.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.config; 2 | 3 | import com.gak.hospital.filter.AuthTokenFilter; 4 | import org.springframework.security.config.annotation.SecurityConfigurerAdapter; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.core.userdetails.UserDetailsService; 7 | import org.springframework.security.web.DefaultSecurityFilterChain; 8 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; 9 | 10 | public class AuthTokenConfigurer extends SecurityConfigurerAdapter { 11 | 12 | private final UserDetailsService detailsService; 13 | 14 | public AuthTokenConfigurer(UserDetailsService detailsService) { 15 | this.detailsService = detailsService; 16 | } 17 | 18 | @Override 19 | public void configure(HttpSecurity http) { 20 | AuthTokenFilter customFilter = new AuthTokenFilter(detailsService); 21 | http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/MedicalRecord.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import org.springframework.data.annotation.CreatedDate; 5 | import javax.persistence.*; 6 | import java.util.Date; 7 | 8 | /** 9 | * 病历 10 | */ 11 | @Entity 12 | @Data 13 | @Table(name="medical_record") 14 | public class MedicalRecord implements java.io.Serializable { 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) 17 | //就诊号 18 | private int id; 19 | //患者id 20 | private int patientId; 21 | private String checklistIds; 22 | private String prescribeIds; 23 | @CreatedDate 24 | private Date createDate; 25 | //0.未检查 1.待付款(已处理) 26 | private int status; 27 | //是否病历 0.否 1.是 >1有还未使用药品或者检查单 28 | private int history; 29 | //备注 30 | private String remark; 31 | //患者名 32 | @Transient 33 | private String userName; 34 | @Transient 35 | private String sexName; 36 | @Transient 37 | private String phone; 38 | @Transient 39 | private String createDateName; 40 | @Transient 41 | private String[] checklistIdsArr; 42 | @Transient 43 | private String[] prescribeIdsArr; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.gak.hospital.entity.User; 5 | import org.springframework.data.domain.Page; 6 | import java.util.List; 7 | 8 | public interface UserService { 9 | 10 | User getUserByToken(String token); 11 | 12 | boolean updateUserByUser(User user); 13 | 14 | boolean updateUserPassword(User user); 15 | 16 | /** 17 | * 添加or更新 管理员 18 | * @param user user 19 | * @return boolean 20 | */ 21 | boolean saveOrUpdate(User user); 22 | 23 | /** 24 | * 分页模糊查询 25 | * @param name name 26 | * @param pageNumber 页 27 | * @param pageSize 一页多少条 28 | * @return page 29 | */ 30 | Page getUserAllByPageAndName(String name, int pageNumber, int pageSize); 31 | 32 | /** 33 | * 根据ids删除 (管理员) 34 | * @param ids ids 35 | * @return boolean 36 | */ 37 | boolean delUserByIds(List ids); 38 | 39 | /** 40 | * 获取指定类型的用户 41 | * @param role role 42 | * @return List 43 | */ 44 | List getAllByRole(String role); 45 | 46 | /** 47 | * 获取账单 48 | * @param user user 49 | * @return json 50 | */ 51 | JSONObject getBill(User user); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/utils/RoleUtils.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.utils; 2 | 3 | public class RoleUtils { 4 | 5 | public static final String USER = "USER"; 6 | public static final String ADMIN = "ADMIN"; 7 | public static final String DOCTOR = "DOCTOR"; 8 | public static final String TECHNICAL = "TECHNICAL"; 9 | public static final String PHARMACIST = "PHARMACIST"; 10 | 11 | public static final String ROLE_USER = "ROLE_" + USER; 12 | public static final String ROLE_ADMIN = "ROLE_" + ADMIN; 13 | public static final String ROLE_DOCTOR = "ROLE_" + DOCTOR; 14 | public static final String ROLE_TECHNICAL = "ROLE_" + TECHNICAL; 15 | public static final String ROLE_PHARMACIST = "ROLE_" + PHARMACIST; 16 | 17 | /** 18 | * 获取权限数组 19 | * @param roles roles 20 | * @return String[] 21 | */ 22 | public static String[] getRoles(String roles) { 23 | return roles.split(","); 24 | } 25 | 26 | /** 27 | * 判断是否存在权限 28 | * @param role role 29 | * @param roles roles 30 | * @return boolean 31 | */ 32 | public static boolean existRole(String role, String roles) { 33 | for (String item: getRoles(roles)) { 34 | if (item.equals(role)) { 35 | return true; 36 | } 37 | } 38 | return false; 39 | } 40 | 41 | private RoleUtils() {} 42 | } 43 | -------------------------------------------------------------------------------- /hospital-web/src/views/home/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 28 | 45 | -------------------------------------------------------------------------------- /hospital-web/src/views/selfHelp/register.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 56 | 57 | 59 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/MedicalRecordService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service; 2 | 3 | import com.gak.hospital.entity.MedicalRecord; 4 | import org.springframework.data.domain.Page; 5 | 6 | import java.util.List; 7 | 8 | public interface MedicalRecordService { 9 | 10 | /** 11 | * 添加or更新 管理员 12 | * @param medicalRecord medicalRecord 13 | * @return boolean 14 | */ 15 | boolean saveOrUpdate(MedicalRecord medicalRecord); 16 | 17 | /** 18 | * 使用数量 19 | * @param num num 20 | * @return boolean 21 | */ 22 | boolean updateHistory(int num, int recordId); 23 | 24 | /** 25 | * 根据userId获取就诊号 26 | */ 27 | int getIdByUserId(int userId); 28 | 29 | /** 30 | * 根据就诊号获取挂号信息 (详情) 非病历 31 | */ 32 | MedicalRecord getMedicalRecordById(int id); 33 | 34 | /** 35 | * 分页模糊查询 (详情)非病历 36 | * @param statusList 状态list 37 | * @param pageNumber pageNumber 38 | * @param pageSize pageSize 39 | * @return page 40 | */ 41 | Page getMedicalRecordAllByPageAndStatusList(List statusList, int pageNumber, int pageSize); 42 | 43 | /** 44 | * 根据就诊号获取挂号信息 详情)病历 45 | */ 46 | MedicalRecord getRecordById(int id); 47 | 48 | /** 49 | * 分页模糊查询 (详情)病历 50 | * @param pageNumber pageNumber 51 | * @param pageSize pageSize 52 | * @return page 53 | */ 54 | Page getRecordAllByPage(String userName, int pageNumber, int pageSize); 55 | 56 | List getMedicalRecordByPatientId(int patientId); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/entity/BillInfo.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.entity; 2 | 3 | import lombok.Data; 4 | import lombok.NonNull; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | 9 | /** 10 | * 账单中间表 11 | */ 12 | @Data 13 | @Entity 14 | public class BillInfo implements java.io.Serializable{ 15 | @Id 16 | private String uuid; 17 | //代表项目的id 18 | private int id; 19 | //就诊号 20 | private int visitNumber; 21 | private String userName; 22 | private String projectName; 23 | private int number; 24 | private float price; 25 | 26 | public BillInfo() {} 27 | 28 | public BillInfo(int visitNumber, String userName, String projectName, int number, float price) { 29 | this.visitNumber = visitNumber; 30 | this.userName = userName; 31 | this.number = number; 32 | this.projectName = projectName; 33 | this.price = price; 34 | } 35 | 36 | public BillInfo(@NonNull Prescribe prescribe,@NonNull Drug drug) { 37 | this.id = prescribe.getId(); 38 | this.visitNumber = prescribe.getVisitNumber(); 39 | this.userName = prescribe.getUserName(); 40 | this.number = prescribe.getDrugNumber(); 41 | this.projectName = drug.getName(); 42 | this.price = drug.getPrice(); 43 | } 44 | 45 | public BillInfo(@NonNull Checklist checklist, @NonNull Medical medical) { 46 | this.id = checklist.getId(); 47 | this.visitNumber = checklist.getVisitNumber(); 48 | this.userName = checklist.getUserName(); 49 | this.number = checklist.getMedicalNumber(); 50 | this.projectName = medical.getMedicalName(); 51 | this.price = medical.getMedicalPrice(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.User; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.util.List; 12 | 13 | public interface UserRepository extends JpaRepository { 14 | 15 | User findFirstUserByUsernameOrPhone(String username, String phone); 16 | 17 | @Modifying 18 | @Transactional 19 | @Query("update User a SET " + 20 | "a.username = CASE WHEN :#{#user.username} IS NULL THEN a.username ELSE :#{#user.username} END ," + 21 | "a.password = CASE WHEN :#{#user.password} IS NULL THEN a.password ELSE :#{#user.password} END ," + 22 | "a.name = CASE WHEN :#{#user.name} IS NULL THEN a.name ELSE :#{#user.name} END ," + 23 | "a.phone = CASE WHEN :#{#user.phone} IS NULL THEN a.phone ELSE :#{#user.phone} END ," + 24 | "a.deptId = CASE WHEN :#{#user.deptId} IS NULL THEN a.deptId ELSE :#{#user.deptId} END ," + 25 | "a.birthDate = CASE WHEN :#{#user.birthDate} IS NULL THEN a.birthDate ELSE :#{#user.birthDate} END ," + 26 | "a.sex = CASE WHEN :#{#user.sex} = 0 THEN a.sex ELSE :#{#user.sex} END ," + 27 | "a.role = CASE WHEN :#{#user.role} IS NULL THEN a.role ELSE :#{#user.role} END " + 28 | "where a.id = :#{#user.id}") 29 | int update(User user); 30 | 31 | User findUserById(int id); 32 | 33 | Page findUserByNameLike(String name, Pageable pageable); 34 | 35 | @Transactional 36 | void deleteUserByIdIn(List ids); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/DeptServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.Dept; 4 | import com.gak.hospital.repository.DeptRepository; 5 | import com.gak.hospital.service.DeptService; 6 | import lombok.NonNull; 7 | import lombok.RequiredArgsConstructor; 8 | import org.springframework.data.domain.Page; 9 | import org.springframework.data.domain.PageRequest; 10 | import org.springframework.data.domain.Pageable; 11 | import org.springframework.stereotype.Service; 12 | import java.util.List; 13 | 14 | @Service 15 | @RequiredArgsConstructor 16 | public class DeptServiceImpl implements DeptService { 17 | 18 | private final @NonNull DeptRepository deptRepository; 19 | 20 | @Override 21 | public Page getDeptAllByPageAndDeptName(String deptName, int pageNumber, int pageSize) { 22 | if (deptName == null || deptName.equals("")) { 23 | deptName = "%%"; 24 | } else { 25 | deptName = "%" + deptName + "%"; 26 | } 27 | Pageable pageable = PageRequest.of(pageNumber - 1, pageSize); 28 | return deptRepository.findDeptByDeptNameLike(deptName, pageable); 29 | } 30 | 31 | @Override 32 | public boolean addOrUpdateDept(Dept dept) { 33 | try { 34 | deptRepository.save(dept); 35 | return true; 36 | } catch (Exception e) { 37 | System.out.println(e.getMessage()); 38 | return false; 39 | } 40 | } 41 | 42 | @Override 43 | public boolean delDeptByIds(List ids) { 44 | try { 45 | deptRepository.deleteDeptByDeptIdIn(ids); 46 | return true; 47 | } catch (Exception e) { 48 | System.out.println(e.getMessage()); 49 | return false; 50 | } 51 | } 52 | 53 | @Override 54 | public List getAll() { 55 | return deptRepository.findAll(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/repository/MedicalRecordRepository.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.repository; 2 | 3 | import com.gak.hospital.entity.MedicalRecord; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.util.List; 12 | 13 | public interface MedicalRecordRepository extends JpaRepository { 14 | 15 | MedicalRecord getFirstMedicalRecordByPatientIdAndStatus(int patientId, int status); 16 | 17 | Page findMedicalRecordByStatusInAndHistoryNot(List statusList, int history, Pageable pageable); 18 | 19 | MedicalRecord findMedicalRecordByIdAndHistoryNot(int id, int history); 20 | 21 | MedicalRecord findMedicalRecordByIdAndHistoryEquals(int id, int history); 22 | 23 | MedicalRecord findMedicalRecordById(int id); 24 | 25 | List findMedicalRecordByStatusAndHistoryGreaterThanAndPatientId(int status, int history, int patientId); 26 | 27 | MedicalRecord getFirstMedicalRecordByPatientIdAndStatusAndHistoryGreaterThan(int patientId, int status, int history); 28 | 29 | @Modifying 30 | @Transactional 31 | @Query("update MedicalRecord m SET " + 32 | "m.history = m.history - :#{#num} " + 33 | "where m.id = :#{#id} and m.history - :#{#num} >= 1") 34 | int updateHistory(int num, int id); 35 | 36 | @Query(value = "select m " + 37 | "from User u LEFT JOIN MedicalRecord m ON u.id = m.patientId " + 38 | "where u.name like :#{#userName} AND m.history = 1") 39 | Page findMedicalRecordByUserNamePageable(String userName, Pageable pageable); 40 | 41 | List findMedicalRecordByPatientId(int patientId); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/MedicalServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.Medical; 4 | import com.gak.hospital.repository.MedicalRepository; 5 | import com.gak.hospital.service.MedicalService; 6 | import lombok.NonNull; 7 | import lombok.RequiredArgsConstructor; 8 | import org.springframework.data.domain.Page; 9 | import org.springframework.data.domain.PageRequest; 10 | import org.springframework.data.domain.Pageable; 11 | import org.springframework.stereotype.Service; 12 | import java.util.List; 13 | 14 | @Service 15 | @RequiredArgsConstructor 16 | public class MedicalServiceImpl implements MedicalService { 17 | 18 | private final @NonNull MedicalRepository medicalRepository; 19 | 20 | @Override 21 | public boolean saveOrUpdate(Medical medical) { 22 | try { 23 | medicalRepository.save(medical); 24 | return true; 25 | } catch (Exception e) { 26 | System.out.println(e.getMessage()); 27 | return false; 28 | } 29 | } 30 | 31 | @Override 32 | public Page getMedicalAllByPageAndMedicalName(String medicalName, int pageNumber, int pageSize) { 33 | if (medicalName == null || medicalName.equals("")) { 34 | medicalName = "%%"; 35 | } else { 36 | medicalName = "%" + medicalName + "%"; 37 | } 38 | Pageable pageable = PageRequest.of(pageNumber - 1, pageSize); 39 | return medicalRepository.findMedicalByMedicalNameLike(medicalName, pageable); 40 | } 41 | 42 | @Override 43 | public boolean delMedicalByIds(List ids) { 44 | try { 45 | medicalRepository.deleteMedicalByMedicalIdIn(ids); 46 | return true; 47 | } catch (Exception e) { 48 | System.out.println(e.getMessage()); 49 | return false; 50 | } 51 | } 52 | 53 | @Override 54 | public List getAll() { 55 | return medicalRepository.findAll(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/utils/TokenUtils.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.utils; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.springframework.security.core.userdetails.UserDetails; 5 | 6 | public class TokenUtils { 7 | 8 | // 有效性 单位毫秒 过期时间1小时 9 | private static final long TOKEN_VALIDITY = 1000L * 60 * 60; 10 | 11 | public static JSONObject createToken(UserDetails userDetails) { 12 | JSONObject tokenJson = new JSONObject(); 13 | long expires = System.currentTimeMillis() + TOKEN_VALIDITY; 14 | tokenJson.put("token", computeSignature(userDetails, expires)); 15 | tokenJson.put("expires", expires); 16 | return tokenJson; 17 | } 18 | 19 | // 验证token 20 | public static boolean validateToken(String authToken, UserDetails userDetails) { 21 | //check token 22 | String username = getUserNameFromToken(authToken); 23 | Long expires = getExpiresFromToken(authToken); 24 | if (username != null && expires != null) { 25 | return userDetails.getUsername().equals(username) && System.currentTimeMillis() < expires; 26 | } 27 | return false; 28 | } 29 | 30 | // 从token中识别用户 31 | public static String getUserNameFromToken(String authToken) { 32 | // …… 33 | int index = authToken.lastIndexOf("|"); 34 | if (index != -1) { 35 | return authToken.substring(0, index); 36 | } 37 | return null; 38 | } 39 | 40 | // 从token中识别过期时间 41 | public static Long getExpiresFromToken(String authToken) { 42 | // …… 43 | int index = authToken.lastIndexOf("|"); 44 | if (index != -1) { 45 | return Long.valueOf(authToken.substring(index + 1)); 46 | } 47 | return null; 48 | } 49 | 50 | private static String computeSignature(UserDetails userDetails, long expires) { 51 | // 一些特有的信息组装 ,并结合某种加密活摘要算法 例如 something+"|"+something2+MD5(s) 52 | return userDetails.getUsername() + "|" + expires; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/DrugServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.Drug; 4 | import com.gak.hospital.repository.DrugRepository; 5 | import com.gak.hospital.service.DrugService; 6 | import com.gak.hospital.utils.DateUtils; 7 | import lombok.NonNull; 8 | import lombok.RequiredArgsConstructor; 9 | import org.springframework.data.domain.Page; 10 | import org.springframework.data.domain.PageRequest; 11 | import org.springframework.data.domain.Pageable; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | @Service 17 | @RequiredArgsConstructor 18 | public class DrugServiceImpl implements DrugService { 19 | 20 | private final @NonNull DrugRepository drugRepository; 21 | 22 | @Override 23 | public boolean saveOrUpdate(Drug drug) { 24 | try { 25 | drugRepository.save(drug); 26 | return true; 27 | } catch (Exception e) { 28 | System.out.println(e.getMessage()); 29 | return false; 30 | } 31 | } 32 | 33 | @Override 34 | public Page getDrugAllByPageAndDrugName(String drugName, int pageNumber, int pageSize) { 35 | if (drugName == null || drugName.equals("")) { 36 | drugName = "%%"; 37 | } else { 38 | drugName = "%" + drugName + "%"; 39 | } 40 | Pageable pageable = PageRequest.of(pageNumber - 1, pageSize); 41 | Page page = drugRepository.findDrugByNameLike(drugName, pageable); 42 | return page.map(drug -> { 43 | drug.setManufactureDateName(DateUtils.formatYMD(drug.getManufactureDate())); 44 | return drug; 45 | }); 46 | } 47 | 48 | @Override 49 | public boolean delDrugByIds(List ids) { 50 | try { 51 | drugRepository.deleteDrugByIdIn(ids); 52 | return true; 53 | } catch (Exception e) { 54 | System.out.println(e.getMessage()); 55 | return false; 56 | } 57 | } 58 | 59 | @Override 60 | public List getAll() { 61 | return drugRepository.findAll(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/CustomUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.gak.hospital.entity.User; 5 | import com.gak.hospital.repository.UserRepository; 6 | import com.gak.hospital.utils.CacheUtils; 7 | import com.gak.hospital.utils.RoleUtils; 8 | import lombok.NonNull; 9 | import lombok.RequiredArgsConstructor; 10 | import org.springframework.security.core.GrantedAuthority; 11 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 12 | import org.springframework.security.core.userdetails.UserDetails; 13 | import org.springframework.security.core.userdetails.UserDetailsService; 14 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 15 | import org.springframework.stereotype.Component; 16 | import java.util.ArrayList; 17 | import java.util.Collection; 18 | 19 | @Component("userDetailsService") 20 | @RequiredArgsConstructor 21 | public class CustomUserDetailsService implements UserDetailsService { 22 | 23 | private final @NonNull UserRepository userRepository; 24 | 25 | @Override 26 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 27 | // 1. 查询用户 28 | User userByUsername = userRepository.findFirstUserByUsernameOrPhone(username, username); 29 | if (userByUsername == null) { 30 | throw new UsernameNotFoundException("login User:" + username + " was not found in db"); 31 | //这里找不到必须抛异常 32 | } 33 | // 2. 设置角色(权限) 34 | Collection grantedAuthorities = new ArrayList<>(); 35 | for(String role : RoleUtils.getRoles(userByUsername.getRole())) { 36 | grantedAuthorities.add(new SimpleGrantedAuthority(role)); 37 | } 38 | // 缓存 39 | JSONObject jsonObject = new JSONObject(); 40 | jsonObject.put("name", userByUsername.getName()); 41 | CacheUtils.single().set(username, jsonObject); 42 | // 3. 封装用户信息返回 参数分别是:用户名,密码,用户权限 new BCryptPasswordEncoder().encode() 43 | return new org.springframework.security.core.userdetails.User(username, 44 | userByUsername.getPassword(), grantedAuthorities); 45 | } 46 | } -------------------------------------------------------------------------------- /hospital-web/src/views/selfHelp/record.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 64 | 65 | 70 | -------------------------------------------------------------------------------- /hospital-web/src/utils/request.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import router from '@/router/index.js' 3 | import Vue from 'vue' 4 | import {Button, Message} from 'element-ui' 5 | 6 | const request = axios.create({ 7 | baseURL: process.env.API, 8 | timeout: 100000, 9 | headers: { 10 | 'Content-Type': "application/json;charset=utf-8" 11 | } 12 | }) 13 | 14 | 15 | // 添加请求拦截器 16 | request.interceptors.request.use(function (config) { 17 | // 每次发送请求之前判断是否存在token,如果存在,则统一在http请求的header都加上token 18 | // 即使本地存在token,也有可能token是过期的,所以在响应拦截器中要对返回状态进行判断 19 | const token = sessionStorage.getItem('token') 20 | token && (config.headers.Authorization = token) 21 | return config 22 | }, function (error) { 23 | // 对请求错误做些什么 24 | return Promise.reject(error) 25 | }) 26 | 27 | // 添加响应拦截器 28 | request.interceptors.response.use(function (response) { 29 | // 对响应数据做点什么 30 | return response 31 | }, function (error) { 32 | // 对响应错误做点什么 33 | switch (error.response.status) { 34 | // 401: 未登录 35 | case 401: 36 | Message({ message: '未登录', type: 'warning' }) 37 | router.replace({ 38 | path: '/login', 39 | query: { redirect: router.currentRoute.fullPath } 40 | }); 41 | break 42 | // 403 没权限 43 | // 登录过期对用户进行提示 44 | // 清除本地token和清空vuex中token对象 45 | // 跳转登录页面 46 | case 403: 47 | Message({ message: '登录过期', type: 'warning' }) 48 | // 清除token 49 | sessionStorage.removeItem('token') 50 | // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 51 | setTimeout(() => { 52 | router.replace({ 53 | path: '/login', 54 | query: { 55 | redirect: router.currentRoute.fullPath 56 | } 57 | }) 58 | }, 1000); 59 | break 60 | // 404请求不存在 61 | case 404: 62 | Message({ message: '找不到页面', type: 'warning' }) 63 | router.replace({ 64 | path: '/404', 65 | query: { redirect: router.currentRoute.fullPath } 66 | }) 67 | break 68 | // 其他错误,直接抛出错误提示 69 | default: 70 | } 71 | return Promise.reject(error) 72 | }) 73 | 74 | //提供 75 | export default request 76 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.controller; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.gak.hospital.entity.User; 5 | import com.gak.hospital.service.impl.CustomUserDetailsService; 6 | import com.gak.hospital.utils.CacheUtils; 7 | import com.gak.hospital.utils.TokenUtils; 8 | import lombok.NonNull; 9 | import lombok.RequiredArgsConstructor; 10 | import org.springframework.http.HttpEntity; 11 | import org.springframework.http.ResponseEntity; 12 | import org.springframework.security.core.Authentication; 13 | import org.springframework.security.authentication.AuthenticationManager; 14 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 15 | import org.springframework.security.core.AuthenticationException; 16 | import org.springframework.security.core.context.SecurityContextHolder; 17 | import org.springframework.security.core.userdetails.UserDetails; 18 | import org.springframework.web.bind.annotation.*; 19 | 20 | @RestController 21 | @RequiredArgsConstructor 22 | @RequestMapping("/login") 23 | public class LoginController { 24 | 25 | private final @NonNull CustomUserDetailsService userDetailsService; 26 | private final @NonNull AuthenticationManager authenticationManager; 27 | 28 | @PostMapping(value = "/auth") 29 | public HttpEntity authorize(@NonNull @RequestBody User user) { 30 | try { 31 | // 1 创建UsernamePasswordAuthenticationToken 32 | UsernamePasswordAuthenticationToken token 33 | = new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword()); 34 | // 2 认证 35 | Authentication authentication = this.authenticationManager.authenticate(token); 36 | // 3 保存认证信息 37 | SecurityContextHolder.getContext().setAuthentication(authentication); 38 | // 4 加载UserDetails 39 | UserDetails details = this.userDetailsService.loadUserByUsername(user.getUsername()); 40 | // 5 生成自定义token 41 | JSONObject tokenJson = TokenUtils.createToken(details); 42 | tokenJson.putAll(CacheUtils.single().get(details.getUsername())); 43 | return ResponseEntity.ok(tokenJson); 44 | } catch (AuthenticationException e) { 45 | System.out.println(e.getMessage()); 46 | return ResponseEntity.ok(false); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/filter/AuthTokenFilter.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.filter; 2 | 3 | import com.gak.hospital.utils.TokenUtils; 4 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 5 | import org.springframework.security.core.context.SecurityContextHolder; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | import org.springframework.security.core.userdetails.UserDetailsService; 8 | import org.springframework.util.StringUtils; 9 | import org.springframework.web.filter.GenericFilterBean; 10 | import javax.servlet.FilterChain; 11 | import javax.servlet.ServletRequest; 12 | import javax.servlet.ServletResponse; 13 | import javax.servlet.http.HttpServletRequest; 14 | 15 | /** 16 | * 登录过滤器 17 | */ 18 | public class AuthTokenFilter extends GenericFilterBean { 19 | 20 | public final static String AUTH_TOKEN_HEADER_NAME = "Authorization"; 21 | 22 | private final UserDetailsService detailsService; 23 | 24 | public AuthTokenFilter(UserDetailsService detailsService) { 25 | this.detailsService = detailsService; 26 | } 27 | 28 | @Override 29 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) { 30 | try { 31 | HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; 32 | String authToken = httpServletRequest.getHeader(AUTH_TOKEN_HEADER_NAME); 33 | System.out.println("Request:" + httpServletRequest.getServletPath()); 34 | if (StringUtils.hasText(authToken)) { 35 | // 从自定义tokenProvider中解析用户 36 | String username = TokenUtils.getUserNameFromToken(authToken); 37 | // 这里仍然是调用我们自定义的UserDetailsService,查库,检查用户名是否存在, 38 | // 如果是伪造的token,可能DB中就找不到username这个人了,抛出异常,认证失败 39 | UserDetails details = detailsService.loadUserByUsername(username); 40 | if (TokenUtils.validateToken(authToken, details)) { 41 | UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(details, details.getPassword(), details.getAuthorities()); 42 | // 这里还是上面见过的,存放认证信息,如果没有走这一步,下面的doFilter就会提示登录了 43 | SecurityContextHolder.getContext().setAuthentication(token); 44 | } 45 | } 46 | // 调用后续的Filter,如果上面的代码逻辑未能复原“session”,SecurityContext中没有想过信息,后面的流程会检测出"需要登录" 47 | filterChain.doFilter(servletRequest, servletResponse); 48 | } catch (Exception ex) { 49 | throw new RuntimeException(ex); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/DrugstoreServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.Drug; 4 | import com.gak.hospital.entity.Drugstore; 5 | import com.gak.hospital.repository.DrugRepository; 6 | import com.gak.hospital.repository.DrugstoreRepository; 7 | import com.gak.hospital.service.DrugstoreService; 8 | import com.gak.hospital.utils.DateUtils; 9 | import lombok.NonNull; 10 | import lombok.RequiredArgsConstructor; 11 | import org.springframework.data.domain.Page; 12 | import org.springframework.data.domain.PageRequest; 13 | import org.springframework.data.domain.Pageable; 14 | import org.springframework.stereotype.Service; 15 | 16 | @Service 17 | @RequiredArgsConstructor 18 | public class DrugstoreServiceImpl implements DrugstoreService { 19 | 20 | private final @NonNull DrugstoreRepository drugstoreRepository; 21 | private final @NonNull DrugRepository drugRepository; 22 | 23 | @Override 24 | public Page getDrugstoreAllByPageAndDrugName(String drugName, int pageNumber, int pageSize) { 25 | if (drugName == null || drugName.equals("")) { 26 | drugName = "%%"; 27 | } else { 28 | drugName = "%" + drugName + "%"; 29 | } 30 | Pageable pageable = PageRequest.of(pageNumber - 1, pageSize); 31 | return drugstoreRepository.findDrugstoreByDrugNameLikeAndNumberNot(drugName, 0, pageable).map(drugstore -> { 32 | Drug drug = drugRepository.findDrugById(drugstore.getDrugId()); 33 | drug.setManufactureDateName(DateUtils.formatYMD(drug.getManufactureDate())); 34 | drugstore.setDrug(drug); 35 | return drugstore; 36 | }); 37 | } 38 | 39 | @Override 40 | public boolean saveOrUpdate(Drugstore drugstore) { 41 | try { 42 | if (drugstore.getDrug() != null) { 43 | drugstore.setDrugId(drugstore.getDrug().getId()); 44 | drugstore.setDrugName(drugstore.getDrug().getName()); 45 | } 46 | Drugstore drugstoreByDrugId = drugstoreRepository.findDrugstoreByDrugId(drugstore.getDrugId()); 47 | //判断更新类型补充数据 48 | if (drugstoreByDrugId != null && drugstore.getDrug() != null) { 49 | drugstoreByDrugId.setNumber(drugstoreByDrugId.getNumber() + drugstore.getNumber()); 50 | drugstore = drugstoreByDrugId; 51 | } 52 | drugstoreRepository.save(drugstore); 53 | return true; 54 | } catch (Exception e) { 55 | System.out.println(e.getMessage()); 56 | return false; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /hospital-web/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: { 14 | '/api': { 15 | target: 'http://localhost:8081/', 16 | changeOrigin: true, 17 | pathRewrite: { 18 | '^/api': '/' 19 | } 20 | } 21 | }, 22 | 23 | // Various Dev Server settings 24 | host: 'localhost', // can be overwritten by process.env.HOST 25 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 26 | autoOpenBrowser: true, 27 | errorOverlay: true, 28 | notifyOnErrors: true, 29 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 30 | 31 | // Use Eslint Loader? 32 | // If true, your code will be linted during bundling and 33 | // linting errors and warnings will be shown in the console. 34 | useEslint: true, 35 | // If true, eslint errors and warnings will also be shown in the error overlay 36 | // in the browser. 37 | showEslintErrorsInOverlay: false, 38 | 39 | /** 40 | * Source Maps 41 | */ 42 | 43 | // https://webpack.js.org/configuration/devtool/#development 44 | devtool: 'cheap-module-eval-source-map', 45 | 46 | // If you have problems debugging vue-files in devtools, 47 | // set this to false - it *may* help 48 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 49 | cacheBusting: true, 50 | 51 | cssSourceMap: true 52 | }, 53 | 54 | build: { 55 | // Template for index.html 56 | index: path.resolve(__dirname, '../dist/index.html'), 57 | 58 | // Paths 59 | assetsRoot: path.resolve(__dirname, '../dist'), 60 | assetsSubDirectory: 'static', 61 | assetsPublicPath: '/', 62 | 63 | /** 64 | * Source Maps 65 | */ 66 | 67 | productionSourceMap: true, 68 | // https://webpack.js.org/configuration/devtool/#production 69 | devtool: '#source-map', 70 | 71 | // Gzip off by default as many popular static hosts such as 72 | // Surge or Netlify already gzip all static assets for you. 73 | // Before setting to `true`, make sure to: 74 | // npm install --save-dev compression-webpack-plugin 75 | productionGzip: false, 76 | productionGzipExtensions: ['scss','js', 'css'], 77 | 78 | // Run the build command with an extra argument to 79 | // View the bundle analyzer report after build finishes: 80 | // `npm run build --report` 81 | // Set to `true` or `false` to always turn it on or off 82 | bundleAnalyzerReport: process.env.npm_config_report 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /hospital-web/theme/element-variables.css: -------------------------------------------------------------------------------- 1 | /* Element Chalk Variables */ 2 | /* Transition 3 | -------------------------- */ 4 | /* Color 5 | -------------------------- */ 6 | /* 53a8ff */ 7 | /* 66b1ff */ 8 | /* 79bbff */ 9 | /* 8cc5ff */ 10 | /* a0cfff */ 11 | /* b3d8ff */ 12 | /* c6e2ff */ 13 | /* d9ecff */ 14 | /* ecf5ff */ 15 | /* Link 16 | -------------------------- */ 17 | /* Border 18 | -------------------------- */ 19 | /* Fill 20 | -------------------------- */ 21 | /* Typography 22 | -------------------------- */ 23 | /* Size 24 | -------------------------- */ 25 | /* z-index 26 | -------------------------- */ 27 | /* Disable base 28 | -------------------------- */ 29 | /* Icon 30 | -------------------------- */ 31 | /* Checkbox 32 | -------------------------- */ 33 | /* Radio 34 | -------------------------- */ 35 | /* Select 36 | -------------------------- */ 37 | /* Alert 38 | -------------------------- */ 39 | /* MessageBox 40 | -------------------------- */ 41 | /* Message 42 | -------------------------- */ 43 | /* Notification 44 | -------------------------- */ 45 | /* Input 46 | -------------------------- */ 47 | /* Cascader 48 | -------------------------- */ 49 | /* Group 50 | -------------------------- */ 51 | /* Tab 52 | -------------------------- */ 53 | /* Button 54 | -------------------------- */ 55 | /* cascader 56 | -------------------------- */ 57 | /* Switch 58 | -------------------------- */ 59 | /* Dialog 60 | -------------------------- */ 61 | /* Table 62 | -------------------------- */ 63 | /* Pagination 64 | -------------------------- */ 65 | /* Popup 66 | -------------------------- */ 67 | /* Popover 68 | -------------------------- */ 69 | /* Tooltip 70 | -------------------------- */ 71 | /* Tag 72 | -------------------------- */ 73 | /* Tree 74 | -------------------------- */ 75 | /* Dropdown 76 | -------------------------- */ 77 | /* Badge 78 | -------------------------- */ 79 | /* Card 80 | --------------------------*/ 81 | /* Slider 82 | --------------------------*/ 83 | /* Steps 84 | --------------------------*/ 85 | /* Menu 86 | --------------------------*/ 87 | /* Rate 88 | --------------------------*/ 89 | /* DatePicker 90 | --------------------------*/ 91 | /* Loading 92 | --------------------------*/ 93 | /* Scrollbar 94 | --------------------------*/ 95 | /* Carousel 96 | --------------------------*/ 97 | /* Collapse 98 | --------------------------*/ 99 | /* Transfer 100 | --------------------------*/ 101 | /* Header 102 | --------------------------*/ 103 | /* Footer 104 | --------------------------*/ 105 | /* Main 106 | --------------------------*/ 107 | /* Timeline 108 | --------------------------*/ 109 | /* Backtop 110 | --------------------------*/ 111 | /* Link 112 | --------------------------*/ 113 | /* Calendar 114 | --------------------------*/ 115 | /* Form 116 | -------------------------- */ 117 | /* Avatar 118 | --------------------------*/ 119 | /* Break-point 120 | --------------------------*/ 121 | -------------------------------------------------------------------------------- /hospital-web/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 73 | 74 | -------------------------------------------------------------------------------- /hospital-web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hospital-ui", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "fengxin <930926134@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "unit": "jest --config test/unit/jest.conf.js --coverage", 11 | "test": "npm run unit", 12 | "lint": "eslint --ext .js,.vue src test/unit", 13 | "build": "node build/build.js" 14 | }, 15 | "dependencies": { 16 | "axios": "^0.19.2", 17 | "element-ui": "^2.13.2", 18 | "file-loader": "^1.1.11", 19 | "less-loader": "^4.1.0", 20 | "node-sass": "^4.14.1", 21 | "nprogress": "^0.2.0", 22 | "scss": "^0.2.4", 23 | "scss-loader": "0.0.1", 24 | "vue": "^2.5.2", 25 | "vue-axios": "^2.1.5", 26 | "vue-enum": "^1.0.5", 27 | "vue-router": "^3.0.1" 28 | }, 29 | "devDependencies": { 30 | "autoprefixer": "^7.1.2", 31 | "babel-core": "^6.22.1", 32 | "babel-eslint": "^8.2.1", 33 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 34 | "babel-jest": "^21.0.2", 35 | "babel-loader": "^7.1.1", 36 | "babel-plugin-dynamic-import-node": "^1.2.0", 37 | "babel-plugin-syntax-jsx": "^6.18.0", 38 | "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", 39 | "babel-plugin-transform-runtime": "^6.22.0", 40 | "babel-plugin-transform-vue-jsx": "^3.5.0", 41 | "babel-preset-env": "^1.3.2", 42 | "babel-preset-stage-2": "^6.22.0", 43 | "chalk": "^2.0.1", 44 | "copy-webpack-plugin": "^4.0.1", 45 | "css-loader": "^0.28.0", 46 | "element-theme-chalk": "^2.13.2", 47 | "eslint": "^4.15.0", 48 | "eslint-config-standard": "^10.2.1", 49 | "eslint-friendly-formatter": "^3.0.0", 50 | "eslint-loader": "^1.7.1", 51 | "eslint-plugin-import": "^2.7.0", 52 | "eslint-plugin-node": "^5.2.0", 53 | "eslint-plugin-promise": "^3.4.0", 54 | "eslint-plugin-standard": "^3.0.1", 55 | "eslint-plugin-vue": "^4.0.0", 56 | "extract-text-webpack-plugin": "^3.0.0", 57 | "file-loader": "^1.1.4", 58 | "friendly-errors-webpack-plugin": "^1.6.1", 59 | "html-webpack-plugin": "^2.30.1", 60 | "jest": "^22.0.4", 61 | "jest-serializer-vue": "^0.3.0", 62 | "node-notifier": "^5.1.2", 63 | "node-sass": "^4.14.1", 64 | "optimize-css-assets-webpack-plugin": "^3.2.0", 65 | "ora": "^1.2.0", 66 | "portfinder": "^1.0.13", 67 | "postcss-import": "^11.0.0", 68 | "postcss-loader": "^2.0.8", 69 | "postcss-url": "^7.2.1", 70 | "rimraf": "^2.6.0", 71 | "sass-loader": "^4.1.0", 72 | "semver": "^5.3.0", 73 | "shelljs": "^0.7.6", 74 | "uglifyjs-webpack-plugin": "^1.1.1", 75 | "url-loader": "^0.5.8", 76 | "vue-jest": "^1.0.2", 77 | "vue-loader": "^13.3.0", 78 | "vue-style-loader": "^3.0.1", 79 | "vue-template-compiler": "^2.5.2", 80 | "webpack": "^3.6.0", 81 | "webpack-bundle-analyzer": "^2.9.0", 82 | "webpack-dev-server": "^2.9.1", 83 | "webpack-merge": "^4.1.0" 84 | }, 85 | "engines": { 86 | "node": ">= 6.0.0", 87 | "npm": ">= 3.0.0" 88 | }, 89 | "browserslist": [ 90 | "> 1%", 91 | "last 2 versions", 92 | "not ie <= 8" 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.0-SNAPSHOT 9 | 10 | 11 | com.gak 12 | hospital 13 | 0.0.1-SNAPSHOT 14 | hospital 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-data-jpa 30 | 31 | 32 | 33 | mysql 34 | mysql-connector-java 35 | 36 | 37 | 38 | org.projectlombok 39 | lombok 40 | true 41 | 42 | 43 | 44 | com.alibaba 45 | fastjson 46 | 1.2.68 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-starter-security 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-starter-web 57 | 58 | 59 | 60 | org.springframework.boot 61 | spring-boot-starter-test 62 | test 63 | 64 | 65 | 66 | 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-maven-plugin 71 | 72 | 73 | 74 | 75 | 76 | 77 | spring-milestones 78 | Spring Milestones 79 | https://repo.spring.io/milestone 80 | 81 | 82 | spring-snapshots 83 | Spring Snapshots 84 | https://repo.spring.io/snapshot 85 | 86 | true 87 | 88 | 89 | 90 | 91 | 92 | spring-milestones 93 | Spring Milestones 94 | https://repo.spring.io/milestone 95 | 96 | 97 | spring-snapshots 98 | Spring Snapshots 99 | https://repo.spring.io/snapshot 100 | 101 | true 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/config/SecurityConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.config; 2 | 3 | import com.gak.hospital.service.impl.CustomUserDetailsService; 4 | import com.gak.hospital.utils.RoleUtils; 5 | import lombok.NonNull; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.security.authentication.AuthenticationManager; 10 | import org.springframework.security.config.BeanIds; 11 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 12 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 13 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 14 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 15 | import org.springframework.security.config.http.SessionCreationPolicy; 16 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 17 | import org.springframework.security.crypto.password.PasswordEncoder; 18 | 19 | @Configuration 20 | @EnableWebSecurity 21 | @RequiredArgsConstructor 22 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { 23 | 24 | private final @NonNull CustomUserDetailsService userDetailsService; 25 | 26 | @Override 27 | protected void configure(HttpSecurity http) throws Exception { 28 | http 29 | .authorizeRequests() 30 | .antMatchers("/user/**").hasRole(RoleUtils.USER) 31 | .antMatchers("/admin/**").hasRole(RoleUtils.ADMIN) 32 | .antMatchers("/doctor/**").hasRole(RoleUtils.DOCTOR) 33 | .antMatchers("/pharmacist/drugAll").hasRole(RoleUtils.DOCTOR) 34 | .antMatchers("/technical/**").hasRole(RoleUtils.TECHNICAL) 35 | .antMatchers("/pharmacist/**").hasRole(RoleUtils.PHARMACIST) 36 | // permitAll 允许所有人访问 37 | .antMatchers("/login/auth").permitAll() 38 | .anyRequest().authenticated() 39 | // 前后端分离不需要配置 form login 和 basic login 40 | //不创建不使用session 41 | .and() 42 | .sessionManagement() 43 | .sessionCreationPolicy(SessionCreationPolicy.STATELESS) 44 | .and() 45 | // 关闭 csrf 防护,放行 post 请求 46 | .csrf() 47 | .disable() 48 | // 这里增加securityConfigurerAdapter 49 | .apply(securityConfigurerAdapter()); 50 | } 51 | 52 | @Override 53 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 54 | auth 55 | .userDetailsService(userDetailsService) // 设置自定义的userDetailsService 56 | .passwordEncoder(passwordEncoder()); 57 | } 58 | 59 | @Bean 60 | public PasswordEncoder passwordEncoder() { 61 | return new BCryptPasswordEncoder(); 62 | } 63 | 64 | @Bean(name = BeanIds.AUTHENTICATION_MANAGER) 65 | @Override 66 | public AuthenticationManager authenticationManagerBean() throws Exception { 67 | return super.authenticationManagerBean(); 68 | } 69 | 70 | private AuthTokenConfigurer securityConfigurerAdapter() { 71 | return new AuthTokenConfigurer(userDetailsService); 72 | } 73 | } -------------------------------------------------------------------------------- /hospital-web/theme/aside.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | .el-aside { 132 | overflow: auto; 133 | -webkit-box-sizing: border-box; 134 | box-sizing: border-box; 135 | -ms-flex-negative: 0; 136 | flex-shrink: 0; } 137 | -------------------------------------------------------------------------------- /hospital-web/src/views/user/upPassword.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 98 | 99 | 101 | -------------------------------------------------------------------------------- /hospital-web/src/components/NavMenu.vue: -------------------------------------------------------------------------------- 1 | 63 | 64 | 77 | 78 | 107 | -------------------------------------------------------------------------------- /hospital-web/theme/steps.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | .el-steps { 132 | display: -webkit-box; 133 | display: -ms-flexbox; 134 | display: flex; } 135 | .el-steps--simple { 136 | padding: 13px 8%; 137 | border-radius: 4px; 138 | background: #F5F7FA; } 139 | .el-steps--horizontal { 140 | white-space: nowrap; } 141 | .el-steps--vertical { 142 | height: 100%; 143 | -webkit-box-orient: vertical; 144 | -webkit-box-direction: normal; 145 | -ms-flex-flow: column; 146 | flex-flow: column; } 147 | -------------------------------------------------------------------------------- /hospital-web/theme/container.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | .el-container { 132 | display: -webkit-box; 133 | display: -ms-flexbox; 134 | display: flex; 135 | -webkit-box-orient: horizontal; 136 | -webkit-box-direction: normal; 137 | -ms-flex-direction: row; 138 | flex-direction: row; 139 | -webkit-box-flex: 1; 140 | -ms-flex: 1; 141 | flex: 1; 142 | -ms-flex-preferred-size: auto; 143 | flex-basis: auto; 144 | -webkit-box-sizing: border-box; 145 | box-sizing: border-box; 146 | min-width: 0; } 147 | .el-container.is-vertical { 148 | -webkit-box-orient: vertical; 149 | -webkit-box-direction: normal; 150 | -ms-flex-direction: column; 151 | flex-direction: column; } 152 | -------------------------------------------------------------------------------- /hospital-web/src/views/selfHelp/pay.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | 131 | 133 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/controller/TechnicalController.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.controller; 2 | 3 | import com.alibaba.fastjson.JSONArray; 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.gak.hospital.entity.Medical; 6 | import com.gak.hospital.service.ChecklistService; 7 | import com.gak.hospital.service.MedicalRecordService; 8 | import com.gak.hospital.service.MedicalService; 9 | import com.gak.hospital.utils.ResultUtils; 10 | import lombok.NonNull; 11 | import lombok.RequiredArgsConstructor; 12 | import org.springframework.http.HttpEntity; 13 | import org.springframework.http.ResponseEntity; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.RequestBody; 16 | import org.springframework.web.bind.annotation.RequestMapping; 17 | import org.springframework.web.bind.annotation.RestController; 18 | 19 | import java.util.List; 20 | 21 | @RestController 22 | @RequestMapping("/technical") 23 | @RequiredArgsConstructor 24 | public class TechnicalController { 25 | 26 | private final @NonNull MedicalService medicalService; 27 | private final @NonNull ChecklistService checklistService; 28 | private final @NonNull MedicalRecordService medicalRecordService; 29 | 30 | /*****************************************医技管理*****************************************/ 31 | @PostMapping("/medical") 32 | public HttpEntity medical(@RequestBody JSONObject object) { 33 | int pageNumber = object.getIntValue("pageNumber"); 34 | String medicalName = object.getString("medicalName"); 35 | int pageSize = object.getIntValue("pageSize"); 36 | if (pageNumber > 0) { 37 | return ResponseEntity.ok(ResultUtils.pageToJson(medicalService.getMedicalAllByPageAndMedicalName(medicalName, pageNumber, pageSize))); 38 | } else { 39 | return ResponseEntity.badRequest().build(); 40 | } 41 | } 42 | 43 | @PostMapping("/medicalAddOrUpdate") 44 | public HttpEntity medicalAddOrUpdate(@RequestBody JSONObject object) { 45 | Medical medical = object.toJavaObject(Medical.class); 46 | if (medical != null) { 47 | return ResponseEntity.ok(medicalService.saveOrUpdate(medical)); 48 | } else { 49 | return ResponseEntity.badRequest().build(); 50 | } 51 | } 52 | 53 | @PostMapping("/medicalDel") 54 | public HttpEntity medicalDel(@RequestBody JSONObject object) { 55 | List ids = JSONObject.parseArray(object.getJSONArray("ids").toJSONString(), Integer.class); 56 | if (ids.size() != 0) { 57 | return ResponseEntity.ok(medicalService.delMedicalByIds(ids)); 58 | } else { 59 | return ResponseEntity.badRequest().build(); 60 | } 61 | } 62 | 63 | /*****************************************检查单管理*****************************************/ 64 | @PostMapping("/checklist") 65 | public HttpEntity checklist(@RequestBody JSONObject object) { 66 | int pageNumber = object.getIntValue("pageNumber"); 67 | String userName = object.getString("userName"); 68 | int pageSize = object.getIntValue("pageSize"); 69 | if (pageNumber > 0) { 70 | return ResponseEntity.ok(ResultUtils.pageToJson(checklistService.getChecklistAllByPageAndUserName(userName, pageNumber, pageSize))); 71 | } else { 72 | return ResponseEntity.badRequest().build(); 73 | } 74 | } 75 | 76 | @PostMapping("/use") 77 | public HttpEntity use(@RequestBody JSONObject object) { 78 | int visitNumber = object.getIntValue("visitNumber"); 79 | List checklistIds = JSONArray.parseArray(object.get("checklistIds").toString(), Integer.class); 80 | if (checklistIds.size() != 0 && checklistService.updateStatusByIds(checklistIds, 2)) { 81 | // 2使用 82 | return ResponseEntity.ok(medicalRecordService.updateHistory(checklistIds.size(), visitNumber)); 83 | } else { 84 | return ResponseEntity.badRequest().build(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.controller; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.gak.hospital.entity.Dept; 5 | import com.gak.hospital.entity.User; 6 | import com.gak.hospital.service.DeptService; 7 | import com.gak.hospital.service.MedicalRecordService; 8 | import com.gak.hospital.service.UserService; 9 | import com.gak.hospital.utils.ResultUtils; 10 | import lombok.NonNull; 11 | import lombok.RequiredArgsConstructor; 12 | import org.springframework.http.HttpEntity; 13 | import org.springframework.http.ResponseEntity; 14 | import org.springframework.web.bind.annotation.*; 15 | import java.util.List; 16 | 17 | @RestController 18 | @RequiredArgsConstructor 19 | @RequestMapping("/admin") 20 | public class AdminController { 21 | 22 | private final @NonNull DeptService deptService; 23 | private final @NonNull UserService userService; 24 | private final @NonNull MedicalRecordService medicalRecordService; 25 | 26 | /*****************************************部门管理*****************************************/ 27 | @PostMapping("/dept") 28 | public HttpEntity dept(@RequestBody JSONObject object) { 29 | int pageNumber = object.getIntValue("pageNumber"); 30 | String deptName = object.getString("deptName"); 31 | int pageSize = object.getIntValue("pageSize"); 32 | if (pageNumber > 0) { 33 | return ResponseEntity.ok(ResultUtils.pageToJson(deptService.getDeptAllByPageAndDeptName(deptName, pageNumber, pageSize))); 34 | } else { 35 | return ResponseEntity.badRequest().build(); 36 | } 37 | } 38 | 39 | @PostMapping("/deptAddOrUpdate") 40 | public HttpEntity deptAddOrUpdate(@RequestBody JSONObject object) { 41 | Dept dept = object.toJavaObject(Dept.class); 42 | if (dept != null) { 43 | return ResponseEntity.ok(deptService.addOrUpdateDept(dept)); 44 | } else { 45 | return ResponseEntity.badRequest().build(); 46 | } 47 | } 48 | 49 | @PostMapping("/deptDel") 50 | public HttpEntity deptDel(@RequestBody JSONObject object) { 51 | List ids = JSONObject.parseArray(object.getJSONArray("ids").toJSONString(), Integer.class); 52 | if (ids.size() != 0) { 53 | return ResponseEntity.ok(deptService.delDeptByIds(ids)); 54 | } else { 55 | return ResponseEntity.badRequest().build(); 56 | } 57 | } 58 | 59 | @GetMapping("/deptAll") 60 | public HttpEntity deptAll() { 61 | return ResponseEntity.ok(deptService.getAll()); 62 | } 63 | 64 | /*****************************************用户管理*****************************************/ 65 | @PostMapping("/user") 66 | public HttpEntity user(@RequestBody JSONObject object) { 67 | int pageNumber = object.getIntValue("pageNumber"); 68 | String name = object.getString("name"); 69 | int pageSize = object.getIntValue("pageSize"); 70 | if (pageNumber > 0) { 71 | return ResponseEntity.ok(ResultUtils.pageToJson(userService.getUserAllByPageAndName(name, pageNumber, pageSize))); 72 | } else { 73 | return ResponseEntity.badRequest().build(); 74 | } 75 | } 76 | 77 | @PostMapping("/userAddOrUpdate") 78 | public HttpEntity userAddOrUpdate(@RequestBody JSONObject object) { 79 | User user = object.toJavaObject(User.class); 80 | if (user != null) { 81 | return ResponseEntity.ok(userService.saveOrUpdate(user)); 82 | } else { 83 | return ResponseEntity.badRequest().build(); 84 | } 85 | } 86 | 87 | @PostMapping("/userDel") 88 | public HttpEntity userDel(@RequestBody JSONObject object) { 89 | List ids = JSONObject.parseArray(object.getJSONArray("ids").toJSONString(), Integer.class); 90 | if (ids.size() != 0) { 91 | return ResponseEntity.ok(userService.delUserByIds(ids)); 92 | } else { 93 | return ResponseEntity.badRequest().build(); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /hospital-web/src/views/user/info.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 126 | 127 | 132 | -------------------------------------------------------------------------------- /hospital-web/theme/reset.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /* Element Chalk Variables */ 3 | /* Transition 4 | -------------------------- */ 5 | /* Color 6 | -------------------------- */ 7 | /* 53a8ff */ 8 | /* 66b1ff */ 9 | /* 79bbff */ 10 | /* 8cc5ff */ 11 | /* a0cfff */ 12 | /* b3d8ff */ 13 | /* c6e2ff */ 14 | /* d9ecff */ 15 | /* ecf5ff */ 16 | /* Link 17 | -------------------------- */ 18 | /* Border 19 | -------------------------- */ 20 | /* Fill 21 | -------------------------- */ 22 | /* Typography 23 | -------------------------- */ 24 | /* Size 25 | -------------------------- */ 26 | /* z-index 27 | -------------------------- */ 28 | /* Disable base 29 | -------------------------- */ 30 | /* Icon 31 | -------------------------- */ 32 | /* Checkbox 33 | -------------------------- */ 34 | /* Radio 35 | -------------------------- */ 36 | /* Select 37 | -------------------------- */ 38 | /* Alert 39 | -------------------------- */ 40 | /* MessageBox 41 | -------------------------- */ 42 | /* Message 43 | -------------------------- */ 44 | /* Notification 45 | -------------------------- */ 46 | /* Input 47 | -------------------------- */ 48 | /* Cascader 49 | -------------------------- */ 50 | /* Group 51 | -------------------------- */ 52 | /* Tab 53 | -------------------------- */ 54 | /* Button 55 | -------------------------- */ 56 | /* cascader 57 | -------------------------- */ 58 | /* Switch 59 | -------------------------- */ 60 | /* Dialog 61 | -------------------------- */ 62 | /* Table 63 | -------------------------- */ 64 | /* Pagination 65 | -------------------------- */ 66 | /* Popup 67 | -------------------------- */ 68 | /* Popover 69 | -------------------------- */ 70 | /* Tooltip 71 | -------------------------- */ 72 | /* Tag 73 | -------------------------- */ 74 | /* Tree 75 | -------------------------- */ 76 | /* Dropdown 77 | -------------------------- */ 78 | /* Badge 79 | -------------------------- */ 80 | /* Card 81 | --------------------------*/ 82 | /* Slider 83 | --------------------------*/ 84 | /* Steps 85 | --------------------------*/ 86 | /* Menu 87 | --------------------------*/ 88 | /* Rate 89 | --------------------------*/ 90 | /* DatePicker 91 | --------------------------*/ 92 | /* Loading 93 | --------------------------*/ 94 | /* Scrollbar 95 | --------------------------*/ 96 | /* Carousel 97 | --------------------------*/ 98 | /* Collapse 99 | --------------------------*/ 100 | /* Transfer 101 | --------------------------*/ 102 | /* Header 103 | --------------------------*/ 104 | /* Footer 105 | --------------------------*/ 106 | /* Main 107 | --------------------------*/ 108 | /* Timeline 109 | --------------------------*/ 110 | /* Backtop 111 | --------------------------*/ 112 | /* Link 113 | --------------------------*/ 114 | /* Calendar 115 | --------------------------*/ 116 | /* Form 117 | -------------------------- */ 118 | /* Avatar 119 | --------------------------*/ 120 | /* Break-point 121 | --------------------------*/ 122 | body { 123 | font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif; 124 | font-weight: 400; 125 | font-size: 14px; 126 | color: #000000; 127 | -webkit-font-smoothing: antialiased; } 128 | 129 | a { 130 | color: #409EFF; 131 | text-decoration: none; } 132 | a:hover, a:focus { 133 | color: #66b1ff; } 134 | a:active { 135 | color: #3a8ee6; } 136 | 137 | h1, h2, h3, h4, h5, h6 { 138 | color: #606266; 139 | font-weight: inherit; } 140 | h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child { 141 | margin-top: 0; } 142 | h1:last-child, h2:last-child, h3:last-child, h4:last-child, h5:last-child, h6:last-child { 143 | margin-bottom: 0; } 144 | 145 | h1 { 146 | font-size: 20px; } 147 | 148 | h2 { 149 | font-size: 18px; } 150 | 151 | h3 { 152 | font-size: 16px; } 153 | 154 | h4, h5, h6, p { 155 | font-size: inherit; } 156 | 157 | p { 158 | line-height: 1.8; } 159 | p:first-child { 160 | margin-top: 0; } 161 | p:last-child { 162 | margin-bottom: 0; } 163 | 164 | sup, sub { 165 | font-size: 13px; } 166 | 167 | small { 168 | font-size: 12px; } 169 | 170 | hr { 171 | margin-top: 20px; 172 | margin-bottom: 20px; 173 | border: 0; 174 | border-top: 1px solid #eeeeee; } 175 | -------------------------------------------------------------------------------- /hospital-web/src/views/index.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 102 | 103 | 146 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/utils/CacheUtils.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.utils; 2 | 3 | import java.util.Map; 4 | import java.util.concurrent.ConcurrentHashMap; 5 | 6 | /** 7 | * Map 缓存 8 | */ 9 | public class CacheUtils { 10 | 11 | /** 12 | * 默认存储1024个缓存 13 | */ 14 | private static final int DEFAULT_CACHES = 1024; 15 | 16 | private static final CacheUtils INS = new CacheUtils(); 17 | 18 | public static CacheUtils single() { 19 | return INS; 20 | } 21 | 22 | /** 23 | * 缓存容器 24 | */ 25 | private static Map cachePool; 26 | 27 | private CacheUtils() { 28 | this(DEFAULT_CACHES); 29 | } 30 | 31 | private CacheUtils(int cacheCount) { 32 | cachePool = new ConcurrentHashMap<>(cacheCount); 33 | } 34 | 35 | /** 36 | * 读取一个缓存 37 | * 38 | * @param key 缓存key 39 | * @param 40 | * @return 41 | */ 42 | public T get(String key) { 43 | CacheObject cacheObject = cachePool.get(key); 44 | if (null != cacheObject) { 45 | long cur = System.currentTimeMillis() / 1000; 46 | if (cacheObject.getExpired() <= 0 || cacheObject.getExpired() > cur) { 47 | Object result = cacheObject.getValue(); 48 | return (T) result; 49 | } 50 | } 51 | return null; 52 | } 53 | 54 | /** 55 | * 读取一个hash类型缓存 56 | * 57 | * @param key 缓存key 58 | * @param field 缓存field 59 | * @param 60 | * @return 61 | */ 62 | public T hget(String key, String field) { 63 | key = key + ":" + field; 64 | return this.get(key); 65 | } 66 | 67 | /** 68 | * 设置一个缓存 69 | * 70 | * @param key 缓存key 71 | * @param value 缓存value 72 | */ 73 | public void set(String key, Object value) { 74 | this.set(key, value, -1); 75 | } 76 | 77 | /** 78 | * 设置一个缓存并带过期时间 79 | * 80 | * @param key 缓存key 81 | * @param value 缓存value 82 | * @param expired 过期时间,单位为秒 83 | */ 84 | public void set(String key, Object value, long expired) { 85 | expired = expired > 0 ? System.currentTimeMillis() / 1000 + expired : expired; 86 | CacheObject cacheObject = new CacheObject(key, value, expired); 87 | cachePool.put(key, cacheObject); 88 | } 89 | 90 | /** 91 | * 设置一个hash缓存 92 | * 93 | * @param key 缓存key 94 | * @param field 缓存field 95 | * @param value 缓存value 96 | */ 97 | public void hset(String key, String field, Object value) { 98 | this.hset(key, field, value, -1); 99 | } 100 | 101 | /** 102 | * 设置一个hash缓存并带过期时间 103 | * 104 | * @param key 缓存key 105 | * @param field 缓存field 106 | * @param value 缓存value 107 | * @param expired 过期时间,单位为秒 108 | */ 109 | public void hset(String key, String field, Object value, long expired) { 110 | key = key + ":" + field; 111 | expired = expired > 0 ? System.currentTimeMillis() / 1000 + expired : expired; 112 | CacheObject cacheObject = new CacheObject(key, value, expired); 113 | cachePool.put(key, cacheObject); 114 | } 115 | 116 | /** 117 | * 根据key删除缓存 118 | * 119 | * @param key 缓存key 120 | */ 121 | public void del(String key) { 122 | cachePool.remove(key); 123 | } 124 | 125 | /** 126 | * 根据key和field删除缓存 127 | * 128 | * @param key 缓存key 129 | * @param field 缓存field 130 | */ 131 | public void hdel(String key, String field) { 132 | key = key + ":" + field; 133 | this.del(key); 134 | } 135 | 136 | /** 137 | * 清空缓存 138 | */ 139 | public void clean() { 140 | cachePool.clear(); 141 | } 142 | 143 | static class CacheObject { 144 | private String key; 145 | private Object value; 146 | private long expired; 147 | 148 | public CacheObject(String key, Object value, long expired) { 149 | this.key = key; 150 | this.value = value; 151 | this.expired = expired; 152 | } 153 | 154 | public String getKey() { 155 | return key; 156 | } 157 | 158 | public Object getValue() { 159 | return value; 160 | } 161 | 162 | public long getExpired() { 163 | return expired; 164 | } 165 | } 166 | } -------------------------------------------------------------------------------- /hospital-web/theme/spinner.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | .el-time-spinner { 132 | width: 100%; 133 | white-space: nowrap; } 134 | 135 | .el-spinner { 136 | display: inline-block; 137 | vertical-align: middle; } 138 | 139 | .el-spinner-inner { 140 | -webkit-animation: rotate 2s linear infinite; 141 | animation: rotate 2s linear infinite; 142 | width: 50px; 143 | height: 50px; } 144 | .el-spinner-inner .path { 145 | stroke: #ececec; 146 | stroke-linecap: round; 147 | -webkit-animation: dash 1.5s ease-in-out infinite; 148 | animation: dash 1.5s ease-in-out infinite; } 149 | 150 | @-webkit-keyframes rotate { 151 | 100% { 152 | -webkit-transform: rotate(360deg); 153 | transform: rotate(360deg); } } 154 | 155 | @keyframes rotate { 156 | 100% { 157 | -webkit-transform: rotate(360deg); 158 | transform: rotate(360deg); } } 159 | 160 | @-webkit-keyframes dash { 161 | 0% { 162 | stroke-dasharray: 1, 150; 163 | stroke-dashoffset: 0; } 164 | 50% { 165 | stroke-dasharray: 90, 150; 166 | stroke-dashoffset: -35; } 167 | 100% { 168 | stroke-dasharray: 90, 150; 169 | stroke-dashoffset: -124; } } 170 | 171 | @keyframes dash { 172 | 0% { 173 | stroke-dasharray: 1, 150; 174 | stroke-dashoffset: 0; } 175 | 50% { 176 | stroke-dasharray: 90, 150; 177 | stroke-dashoffset: -35; } 178 | 100% { 179 | stroke-dasharray: 90, 150; 180 | stroke-dashoffset: -124; } } 181 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/PrescribeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.Drug; 4 | import com.gak.hospital.entity.MedicalRecord; 5 | import com.gak.hospital.entity.Prescribe; 6 | import com.gak.hospital.entity.User; 7 | import com.gak.hospital.repository.DrugRepository; 8 | import com.gak.hospital.repository.MedicalRecordRepository; 9 | import com.gak.hospital.repository.PrescribeRepository; 10 | import com.gak.hospital.repository.UserRepository; 11 | import com.gak.hospital.service.PrescribeService; 12 | import lombok.NonNull; 13 | import lombok.RequiredArgsConstructor; 14 | import org.springframework.data.domain.Page; 15 | import org.springframework.data.domain.PageRequest; 16 | import org.springframework.data.domain.Pageable; 17 | import org.springframework.data.domain.Sort; 18 | import org.springframework.stereotype.Service; 19 | 20 | import java.util.Date; 21 | import java.util.List; 22 | 23 | @Service 24 | @RequiredArgsConstructor 25 | public class PrescribeServiceImpl implements PrescribeService { 26 | 27 | private final @NonNull PrescribeRepository prescribeRepository; 28 | private final @NonNull MedicalRecordRepository medicalRecordRepository; 29 | private final @NonNull UserRepository userRepository; 30 | private final @NonNull DrugRepository drugRepository; 31 | 32 | @Override 33 | public boolean addOrUpdate(Prescribe prescribe) { 34 | try { 35 | final boolean isAdd = prescribe.getId() == 0; 36 | if (isAdd) { 37 | prescribe.setCreateDate(new Date()); 38 | } 39 | Prescribe save = prescribeRepository.save(prescribe); 40 | if (isAdd) { 41 | MedicalRecord medicalRecord = medicalRecordRepository.findMedicalRecordById(save.getVisitNumber()); 42 | final String head = medicalRecord.getPrescribeIds()==null?"":medicalRecord.getPrescribeIds(); 43 | medicalRecord.setPrescribeIds(head + save.getId() + ","); 44 | medicalRecordRepository.save(medicalRecord); 45 | } 46 | return true; 47 | } catch (Exception e) { 48 | System.out.println(e.getMessage()); 49 | return false; 50 | } 51 | } 52 | 53 | @Override 54 | public Prescribe getPrescribeById(int id) { 55 | return prescribeRepository.findPrescribeById(id); 56 | } 57 | 58 | @Override 59 | public boolean delPrescribeById(int id) { 60 | try { 61 | Prescribe prescribeById = prescribeRepository.findPrescribeById(id); 62 | MedicalRecord medicalRecord = medicalRecordRepository.findMedicalRecordById(prescribeById.getVisitNumber()); 63 | StringBuilder sb = new StringBuilder(); 64 | for (String item : medicalRecord.getPrescribeIds().split(",")) { 65 | if (!item.equals(String.valueOf(id))) { 66 | sb.append(item).append(","); 67 | } 68 | } 69 | medicalRecord.setPrescribeIds(sb.toString()); 70 | medicalRecordRepository.save(medicalRecord); 71 | prescribeRepository.deleteById(id); 72 | return true; 73 | } catch (Exception e) { 74 | System.out.println(e.getMessage()); 75 | return false; 76 | } 77 | } 78 | 79 | @Override 80 | public boolean updateStatusByIds(List prescribeIds, int status) { 81 | try { 82 | //1.待使用 83 | return prescribeRepository.updateStatus(prescribeIds, status) > 0; 84 | } catch (Exception e) { 85 | System.out.println(e.getMessage()); 86 | return false; 87 | } 88 | } 89 | 90 | @Override 91 | public Page getPrescribeAllByPageAndUserName(String userName, int pageNumber, int pageSize) { 92 | if (userName == null || userName.equals("")) { 93 | userName = "%%"; 94 | } else { 95 | userName = "%" + userName + "%"; 96 | } 97 | Sort sort = Sort.by(Sort.Direction.ASC, "status"); 98 | Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, sort); 99 | return prescribeRepository.findPrescribeByUserNameLike(userName, pageable).map(prescribe -> { 100 | User user = userRepository.findUserById(prescribe.getDoctorId()); 101 | Drug drug = drugRepository.findDrugById(prescribe.getDrugId()); 102 | prescribe.setDoctorName(user.getName()); 103 | prescribe.setDrugName(drug.getName()); 104 | return prescribe; 105 | }); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/ChecklistServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.Checklist; 4 | import com.gak.hospital.entity.Medical; 5 | import com.gak.hospital.entity.MedicalRecord; 6 | import com.gak.hospital.entity.User; 7 | import com.gak.hospital.repository.ChecklistRepository; 8 | import com.gak.hospital.repository.MedicalRecordRepository; 9 | import com.gak.hospital.repository.MedicalRepository; 10 | import com.gak.hospital.repository.UserRepository; 11 | import com.gak.hospital.service.ChecklistService; 12 | import lombok.NonNull; 13 | import lombok.RequiredArgsConstructor; 14 | import org.springframework.data.domain.Page; 15 | import org.springframework.data.domain.PageRequest; 16 | import org.springframework.data.domain.Pageable; 17 | import org.springframework.data.domain.Sort; 18 | import org.springframework.stereotype.Service; 19 | 20 | import java.util.Date; 21 | import java.util.List; 22 | 23 | @Service 24 | @RequiredArgsConstructor 25 | public class ChecklistServiceImpl implements ChecklistService { 26 | 27 | private final @NonNull ChecklistRepository checklistRepository; 28 | private final @NonNull MedicalRecordRepository medicalRecordRepository; 29 | private final @NonNull UserRepository userRepository; 30 | private final @NonNull MedicalRepository medicalRepository; 31 | 32 | @Override 33 | public boolean addOrUpdate(Checklist checklist) { 34 | try { 35 | final boolean isAdd = checklist.getId() == 0; 36 | if (isAdd) { 37 | checklist.setCreateDate(new Date()); 38 | } 39 | Checklist save = checklistRepository.save(checklist); 40 | //添加 41 | if (isAdd) { 42 | MedicalRecord medicalRecord = medicalRecordRepository.findMedicalRecordById(checklist.getVisitNumber()); 43 | final String head = medicalRecord.getChecklistIds()==null?"":medicalRecord.getChecklistIds(); 44 | medicalRecord.setChecklistIds(head + save.getId() + ","); 45 | medicalRecordRepository.save(medicalRecord); 46 | } 47 | return true; 48 | } catch (Exception e) { 49 | System.out.println(e.getMessage()); 50 | return false; 51 | } 52 | } 53 | 54 | @Override 55 | public Checklist getChecklistById(int id) { 56 | return checklistRepository.findChecklistById(id); 57 | } 58 | 59 | @Override 60 | public boolean delChecklistById(int id) { 61 | try { 62 | Checklist checklistById = checklistRepository.findChecklistById(id); 63 | MedicalRecord medicalRecord = medicalRecordRepository.findMedicalRecordById(checklistById.getVisitNumber()); 64 | StringBuilder sb = new StringBuilder(); 65 | for (String item : medicalRecord.getChecklistIds().split(",")) { 66 | if (!item.equals(String.valueOf(id))) { 67 | sb.append(item).append(","); 68 | } 69 | } 70 | medicalRecord.setChecklistIds(sb.toString()); 71 | medicalRecordRepository.save(medicalRecord); 72 | checklistRepository.deleteById(id); 73 | return true; 74 | } catch (Exception e) { 75 | System.out.println(e.getMessage()); 76 | return false; 77 | } 78 | } 79 | 80 | @Override 81 | public boolean updateStatusByIds(List checklistIds, int status) { 82 | try { 83 | //1.待使用 84 | return checklistRepository.updateStatus(checklistIds, status) > 0; 85 | } catch (Exception e) { 86 | System.out.println(e.getMessage()); 87 | return false; 88 | } 89 | } 90 | 91 | @Override 92 | public Page getChecklistAllByPageAndUserName(String userName, int pageNumber, int pageSize) { 93 | if (userName == null || userName.equals("")) { 94 | userName = "%%"; 95 | } else { 96 | userName = "%" + userName + "%"; 97 | } 98 | Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.ASC, "status")); 99 | return checklistRepository.findChecklistByUserNameLike(userName, pageable).map(checklist -> { 100 | User user = userRepository.findUserById(checklist.getDoctorId()); 101 | Medical medical = medicalRepository.findMedicalByMedicalId(checklist.getMedicalId()); 102 | checklist.setDoctorName(user.getName()); 103 | checklist.setMedicalName(medical.getMedicalName()); 104 | return checklist; 105 | }); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/controller/PharmacistController.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.controller; 2 | 3 | import com.alibaba.fastjson.JSONArray; 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.gak.hospital.entity.Drug; 6 | import com.gak.hospital.entity.Drugstore; 7 | import com.gak.hospital.service.DrugService; 8 | import com.gak.hospital.service.DrugstoreService; 9 | import com.gak.hospital.service.MedicalRecordService; 10 | import com.gak.hospital.service.PrescribeService; 11 | import com.gak.hospital.utils.ResultUtils; 12 | import lombok.NonNull; 13 | import lombok.RequiredArgsConstructor; 14 | import org.springframework.http.HttpEntity; 15 | import org.springframework.http.ResponseEntity; 16 | import org.springframework.web.bind.annotation.*; 17 | 18 | import java.util.List; 19 | 20 | @RestController 21 | @RequestMapping("/pharmacist") 22 | @RequiredArgsConstructor 23 | public class PharmacistController { 24 | 25 | private final @NonNull DrugstoreService drugstoreService; 26 | private final @NonNull DrugService drugService; 27 | private final @NonNull PrescribeService prescribeService; 28 | private final @NonNull MedicalRecordService medicalRecordService; 29 | 30 | /*****************************************药房管理*****************************************/ 31 | @PostMapping("/drugstore") 32 | public HttpEntity drugstore(@RequestBody JSONObject object) { 33 | int pageNumber = object.getIntValue("pageNumber"); 34 | String drugName = object.getString("drugName"); 35 | int pageSize = object.getIntValue("pageSize"); 36 | if (pageNumber > 0) { 37 | return ResponseEntity.ok(ResultUtils.pageToJson(drugstoreService.getDrugstoreAllByPageAndDrugName(drugName, pageNumber, pageSize))); 38 | } else { 39 | return ResponseEntity.badRequest().build(); 40 | } 41 | } 42 | 43 | @PostMapping("/drugstoreAddOrUpdate") 44 | public HttpEntity drugstoreAddOrUpdate(@RequestBody JSONObject object) { 45 | Drugstore drugstore = object.toJavaObject(Drugstore.class); 46 | if (drugstore != null) { 47 | return ResponseEntity.ok(drugstoreService.saveOrUpdate(drugstore)); 48 | } else { 49 | return ResponseEntity.badRequest().build(); 50 | } 51 | } 52 | 53 | @GetMapping("/drugAll") 54 | public HttpEntity drugAll() { 55 | return ResponseEntity.ok(drugService.getAll()); 56 | } 57 | 58 | /*****************************************药品管理*****************************************/ 59 | @PostMapping("/drug") 60 | public HttpEntity drug(@RequestBody JSONObject object) { 61 | int pageNumber = object.getIntValue("pageNumber"); 62 | String drugName = object.getString("drugName"); 63 | int pageSize = object.getIntValue("pageSize"); 64 | if (pageNumber > 0) { 65 | return ResponseEntity.ok(ResultUtils.pageToJson(drugService.getDrugAllByPageAndDrugName(drugName, pageNumber, pageSize))); 66 | } else { 67 | return ResponseEntity.badRequest().build(); 68 | } 69 | } 70 | 71 | @PostMapping("/drugAddOrUpdate") 72 | public HttpEntity drugAddOrUpdate(@RequestBody JSONObject object) { 73 | Drug drug = object.toJavaObject(Drug.class); 74 | if (drug != null) { 75 | return ResponseEntity.ok(drugService.saveOrUpdate(drug)); 76 | } else { 77 | return ResponseEntity.badRequest().build(); 78 | } 79 | } 80 | 81 | @PostMapping("/drugDel") 82 | public HttpEntity drugDel(@RequestBody JSONObject object) { 83 | List ids = JSONObject.parseArray(object.getJSONArray("ids").toJSONString(), Integer.class); 84 | if (ids.size() != 0) { 85 | return ResponseEntity.ok(drugService.delDrugByIds(ids)); 86 | } else { 87 | return ResponseEntity.badRequest().build(); 88 | } 89 | } 90 | 91 | /*****************************************处方管理*****************************************/ 92 | @PostMapping("/prescribe") 93 | public HttpEntity prescribe(@RequestBody JSONObject object) { 94 | int pageNumber = object.getIntValue("pageNumber"); 95 | String userName = object.getString("userName"); 96 | int pageSize = object.getIntValue("pageSize"); 97 | if (pageNumber > 0) { 98 | return ResponseEntity.ok(ResultUtils.pageToJson(prescribeService.getPrescribeAllByPageAndUserName(userName, pageNumber, pageSize))); 99 | } else { 100 | return ResponseEntity.badRequest().build(); 101 | } 102 | } 103 | 104 | /** 105 | * 一次只能使用一个就诊号 106 | */ 107 | @PostMapping("/use") 108 | public HttpEntity use(@RequestBody JSONObject object) { 109 | int visitNumber = object.getIntValue("visitNumber"); 110 | List prescribeIds = JSONArray.parseArray(object.get("prescribeIds").toString(), Integer.class); 111 | if (prescribeIds.size() != 0 && prescribeService.updateStatusByIds(prescribeIds, 2)) { 112 | // 2使用 113 | return ResponseEntity.ok(medicalRecordService.updateHistory(prescribeIds.size(), visitNumber)); 114 | } else { 115 | return ResponseEntity.badRequest().build(); 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /hospital-web/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import NProgress from 'nprogress' 4 | import 'nprogress/nprogress.css' 5 | 6 | //配置父容器 7 | NProgress.configure({ parent: '#app' }); 8 | //关闭旋转 9 | NProgress.configure({ showSpinner: false }); 10 | //速度 11 | NProgress.configure({ trickleSpeed: 200 }); 12 | 13 | Vue.use(Router) 14 | 15 | //路由重复问题解决 加在刚引用的下方部位 16 | const originalPush = Router.prototype.push 17 | Router.prototype.push = function push(location) { 18 | return originalPush.call(this, location).catch(err => err) 19 | } 20 | 21 | //定义routes路由的集合,数组类型 单个路由均为对象类型,path代表的是路径,component代表组件 22 | const routes = [ 23 | 24 | { 25 | path: '/', 26 | component: () => import('@/views/index'), 27 | redirect: 'home', 28 | children: [ 29 | { 30 | // 当 /home 匹配成功, 31 | // /home/index 会被渲染在 index 的 中 32 | path: 'home', 33 | name: 'Home', 34 | meta: { name: '首页'}, 35 | component: () => import('@/views/home/index') 36 | }, 37 | 38 | { 39 | path: 'info', 40 | name: 'Info', 41 | meta: { name: '个人信息'}, 42 | component: () => import('@/views/user/info') 43 | }, 44 | 45 | //门诊挂号 46 | { 47 | path: '/appointment', 48 | name: 'Appointment', 49 | meta: { name: '门诊挂号'}, 50 | component: () => import('@/views/selfHelp/register') 51 | }, 52 | 53 | //门诊挂号 54 | { 55 | path: '/pay', 56 | name: 'Pay', 57 | meta: { name: '自助缴费'}, 58 | component: () => import('@/views/selfHelp/pay') 59 | }, 60 | 61 | { 62 | path: '/record', 63 | name: 'Record', 64 | meta: { name: '挂号记录'}, 65 | component: () => import('@/views/selfHelp/record') 66 | }, 67 | 68 | { 69 | path: '/reg', 70 | name: 'Reg', 71 | meta: { name: '挂号信息'}, 72 | component: () => import('@/views/reg/index') 73 | }, 74 | 75 | //科室管理 76 | { 77 | path: 'dept', 78 | name: 'Dept', 79 | meta: { name: '科室管理'}, 80 | component: () => import('@/views/dept/index') 81 | }, 82 | 83 | //药品管理 84 | { 85 | path: 'drug', 86 | name: 'Drug', 87 | meta: { name: '药品管理'}, 88 | component: () => import('@/views/drug/index') 89 | }, 90 | 91 | { 92 | path: 'checklist', 93 | name: 'Checklist', 94 | meta: { name: '检查单管理'}, 95 | component: () => import('@/views/checklist/index') 96 | }, 97 | 98 | { 99 | path: 'history', 100 | name: 'History', 101 | meta: { name: '查看病历'}, 102 | component: () => import('@/views/history/index') 103 | }, 104 | 105 | { 106 | path: 'prescribe', 107 | name: 'Prescribe', 108 | meta: { name: '处方管理'}, 109 | component: () => import('@/views/prescribe/index') 110 | }, 111 | 112 | { 113 | path: 'drugstore', 114 | name: 'Drugstore', 115 | meta: { name: '药房管理'}, 116 | component: () => import('@/views/drugstore/index') 117 | }, 118 | 119 | //医技管理 120 | { 121 | path: 'medical', 122 | name: 'Medical', 123 | meta: { name: '医技管理'}, 124 | component: () => import('@/views/medical/index') 125 | }, 126 | 127 | //用户管理 128 | { 129 | path: 'user', 130 | name: 'User', 131 | meta: { name: '用户管理'}, 132 | component: () => import('@/views/user/index') 133 | }, 134 | 135 | { 136 | path: 'upPassword', 137 | name: 'UpPassword', 138 | meta: { name: '修改密码'}, 139 | component: () => import('@/views/user/upPassword') 140 | }, 141 | 142 | { 143 | path: '404', 144 | name: '404', 145 | meta: { name: '404'}, 146 | component: () => import('@/views/404') 147 | } 148 | ] 149 | }, 150 | 151 | { 152 | path: '/login', 153 | component: () => import('@/views/login') 154 | }, 155 | 156 | //可以配置重定向 157 | { path:'/*', redirect:"/404" } 158 | ] 159 | 160 | //实例化VueRouter并将routes添加进去 161 | const router = new Router({ 162 | //ES6简写,等于routes:routes 163 | routes 164 | }); 165 | 166 | //路由守卫 167 | router.beforeEach((to, from, next)=>{ 168 | //启动进度条 169 | NProgress.start() 170 | NProgress.inc() 171 | //设置浏览器标题 172 | window.document.title = to.meta.title || '医院管理系统' 173 | if(sessionStorage.getItem('token')){ 174 | //实际还需要验证token有效期 175 | if(to.path === '/login'){ 176 | //登录状态下 访问login.vue页面 会跳到主页 177 | next({path: '/'}) 178 | }else{ 179 | next() 180 | } 181 | }else{ 182 | // 如果没有session ,访问任何页面。都会进入到 登录页 183 | if (to.path === '/login') { // 如果是登录页面的话,直接next() -->解决注销后的循环执行bug 184 | next() 185 | } else { // 否则 跳转到登录页面 186 | next({ path: '/login' }) 187 | } 188 | } 189 | }) 190 | 191 | router.afterEach(() => { 192 | NProgress.done() 193 | }) 194 | 195 | //抛出这个这个实例对象方便外部读取以及访问 196 | export default router 197 | -------------------------------------------------------------------------------- /.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.controller; 2 | 3 | import com.alibaba.fastjson.JSONArray; 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.gak.hospital.entity.MedicalRecord; 6 | import com.gak.hospital.entity.User; 7 | import com.gak.hospital.filter.AuthTokenFilter; 8 | import com.gak.hospital.service.ChecklistService; 9 | import com.gak.hospital.service.MedicalRecordService; 10 | import com.gak.hospital.service.PrescribeService; 11 | import com.gak.hospital.service.UserService; 12 | import com.gak.hospital.utils.ResultUtils; 13 | import lombok.NonNull; 14 | import lombok.RequiredArgsConstructor; 15 | import org.springframework.http.HttpEntity; 16 | import org.springframework.http.ResponseEntity; 17 | import org.springframework.web.bind.annotation.*; 18 | import javax.servlet.http.HttpServletRequest; 19 | import java.util.List; 20 | 21 | @RestController 22 | @RequestMapping("/user") 23 | @RequiredArgsConstructor 24 | public class UserController { 25 | 26 | private final @NonNull UserService userService; 27 | private final @NonNull MedicalRecordService medicalRecordService; 28 | private final @NonNull ChecklistService checklistService; 29 | private final @NonNull PrescribeService prescribeService; 30 | /*****************************************基本信息管理*****************************************/ 31 | @PostMapping("/info") 32 | public HttpEntity info(HttpServletRequest httpServletRequest) { 33 | String token = httpServletRequest.getHeader(AuthTokenFilter.AUTH_TOKEN_HEADER_NAME); 34 | return ResponseEntity.ok(userService.getUserByToken(token)); 35 | } 36 | 37 | @PostMapping("/update") 38 | public HttpEntity update(@NonNull @RequestBody User user) { 39 | return ResponseEntity.ok(userService.updateUserByUser(user)); 40 | } 41 | 42 | @PostMapping("/updatePassword") 43 | public HttpEntity updatePassword(@NonNull @RequestBody User user) { 44 | return ResponseEntity.ok(userService.updateUserPassword(user)); 45 | } 46 | 47 | /*****************************************自助挂号*****************************************/ 48 | 49 | //挂号 成功返回就诊号 50 | @GetMapping("/appointment") 51 | public HttpEntity appointment(HttpServletRequest httpServletRequest) { 52 | String token = httpServletRequest.getHeader(AuthTokenFilter.AUTH_TOKEN_HEADER_NAME); 53 | User userByToken = userService.getUserByToken(token); 54 | if (userByToken != null) { 55 | MedicalRecord medicalRecord = new MedicalRecord(); 56 | medicalRecord.setPatientId(userByToken.getId()); 57 | if (medicalRecordService.saveOrUpdate(medicalRecord)) { 58 | return ResponseEntity.ok(medicalRecordService.getIdByUserId(userByToken.getId())); 59 | } 60 | } 61 | return ResponseEntity.badRequest().build(); 62 | } 63 | 64 | /** 65 | * 检查是否已挂号 返回就诊号 66 | */ 67 | @GetMapping("/visit") 68 | public HttpEntity visit(HttpServletRequest httpServletRequest) { 69 | String token = httpServletRequest.getHeader(AuthTokenFilter.AUTH_TOKEN_HEADER_NAME); 70 | User userByToken = userService.getUserByToken(token); 71 | if (userByToken != null) { 72 | return ResponseEntity.ok(medicalRecordService.getIdByUserId(userByToken.getId())); 73 | } else { 74 | return ResponseEntity.badRequest().build(); 75 | } 76 | } 77 | 78 | /*****************************************自助缴费*****************************************/ 79 | 80 | //获取账单 81 | @GetMapping("/bill") 82 | public HttpEntity bill(HttpServletRequest httpServletRequest) { 83 | String token = httpServletRequest.getHeader(AuthTokenFilter.AUTH_TOKEN_HEADER_NAME); 84 | User userByToken = userService.getUserByToken(token); 85 | if (userByToken != null) { 86 | return ResponseEntity.ok(userService.getBill(userByToken).toJSONString()); 87 | } 88 | return ResponseEntity.badRequest().build(); 89 | } 90 | 91 | //付钱过后回调这个接口即可刷新状态 92 | @PostMapping("/payment") 93 | public HttpEntity payment(@NonNull @RequestBody JSONObject object) { 94 | List checklistIds = JSONArray.parseArray(object.get("checklistIds").toString(), Integer.class); 95 | List prescribeIds = JSONArray.parseArray(object.get("prescribeIds").toString(), Integer.class); 96 | if (checklistIds.size() != 0) { 97 | if (!checklistService.updateStatusByIds(checklistIds, 1)) { 98 | return ResponseEntity.badRequest().build(); 99 | } 100 | } 101 | if (prescribeIds.size() != 0) { 102 | if (!prescribeService.updateStatusByIds(prescribeIds, 1)) { 103 | return ResponseEntity.badRequest().build(); 104 | } 105 | } 106 | return ResponseEntity.ok(true); 107 | } 108 | 109 | /*****************************************挂号记录*****************************************/ 110 | 111 | @GetMapping("/record") 112 | public HttpEntity record(HttpServletRequest httpServletRequest) { 113 | String token = httpServletRequest.getHeader(AuthTokenFilter.AUTH_TOKEN_HEADER_NAME); 114 | User userByToken = userService.getUserByToken(token); 115 | if (userByToken != null) { 116 | return ResponseEntity.ok(userService.getBill(userByToken).toJSONString()); 117 | } 118 | return ResponseEntity.badRequest().build(); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /hospital-web/theme/radio-group.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | /* Element Chalk Variables */ 132 | /* Transition 133 | -------------------------- */ 134 | /* Color 135 | -------------------------- */ 136 | /* 53a8ff */ 137 | /* 66b1ff */ 138 | /* 79bbff */ 139 | /* 8cc5ff */ 140 | /* a0cfff */ 141 | /* b3d8ff */ 142 | /* c6e2ff */ 143 | /* d9ecff */ 144 | /* ecf5ff */ 145 | /* Link 146 | -------------------------- */ 147 | /* Border 148 | -------------------------- */ 149 | /* Fill 150 | -------------------------- */ 151 | /* Typography 152 | -------------------------- */ 153 | /* Size 154 | -------------------------- */ 155 | /* z-index 156 | -------------------------- */ 157 | /* Disable base 158 | -------------------------- */ 159 | /* Icon 160 | -------------------------- */ 161 | /* Checkbox 162 | -------------------------- */ 163 | /* Radio 164 | -------------------------- */ 165 | /* Select 166 | -------------------------- */ 167 | /* Alert 168 | -------------------------- */ 169 | /* MessageBox 170 | -------------------------- */ 171 | /* Message 172 | -------------------------- */ 173 | /* Notification 174 | -------------------------- */ 175 | /* Input 176 | -------------------------- */ 177 | /* Cascader 178 | -------------------------- */ 179 | /* Group 180 | -------------------------- */ 181 | /* Tab 182 | -------------------------- */ 183 | /* Button 184 | -------------------------- */ 185 | /* cascader 186 | -------------------------- */ 187 | /* Switch 188 | -------------------------- */ 189 | /* Dialog 190 | -------------------------- */ 191 | /* Table 192 | -------------------------- */ 193 | /* Pagination 194 | -------------------------- */ 195 | /* Popup 196 | -------------------------- */ 197 | /* Popover 198 | -------------------------- */ 199 | /* Tooltip 200 | -------------------------- */ 201 | /* Tag 202 | -------------------------- */ 203 | /* Tree 204 | -------------------------- */ 205 | /* Dropdown 206 | -------------------------- */ 207 | /* Badge 208 | -------------------------- */ 209 | /* Card 210 | --------------------------*/ 211 | /* Slider 212 | --------------------------*/ 213 | /* Steps 214 | --------------------------*/ 215 | /* Menu 216 | --------------------------*/ 217 | /* Rate 218 | --------------------------*/ 219 | /* DatePicker 220 | --------------------------*/ 221 | /* Loading 222 | --------------------------*/ 223 | /* Scrollbar 224 | --------------------------*/ 225 | /* Carousel 226 | --------------------------*/ 227 | /* Collapse 228 | --------------------------*/ 229 | /* Transfer 230 | --------------------------*/ 231 | /* Header 232 | --------------------------*/ 233 | /* Footer 234 | --------------------------*/ 235 | /* Main 236 | --------------------------*/ 237 | /* Timeline 238 | --------------------------*/ 239 | /* Backtop 240 | --------------------------*/ 241 | /* Link 242 | --------------------------*/ 243 | /* Calendar 244 | --------------------------*/ 245 | /* Form 246 | -------------------------- */ 247 | /* Avatar 248 | --------------------------*/ 249 | /* Break-point 250 | --------------------------*/ 251 | .el-radio-group { 252 | display: inline-block; 253 | line-height: 1; 254 | vertical-align: middle; 255 | font-size: 0; } 256 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/service/impl/MedicalRecordServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.service.impl; 2 | 3 | import com.gak.hospital.entity.MedicalRecord; 4 | import com.gak.hospital.entity.User; 5 | import com.gak.hospital.repository.MedicalRecordRepository; 6 | import com.gak.hospital.repository.UserRepository; 7 | import com.gak.hospital.service.MedicalRecordService; 8 | import com.gak.hospital.utils.DateUtils; 9 | import lombok.NonNull; 10 | import lombok.RequiredArgsConstructor; 11 | import org.springframework.data.domain.Page; 12 | import org.springframework.data.domain.PageRequest; 13 | import org.springframework.data.domain.Sort; 14 | import org.springframework.stereotype.Service; 15 | import java.util.Date; 16 | import java.util.List; 17 | 18 | @Service 19 | @RequiredArgsConstructor 20 | public class MedicalRecordServiceImpl implements MedicalRecordService { 21 | 22 | private final @NonNull MedicalRecordRepository medicalRecordRepository; 23 | private final @NonNull UserRepository userRepository; 24 | 25 | @Override 26 | public boolean saveOrUpdate(MedicalRecord medicalRecord) { 27 | try { 28 | if (medicalRecord.getId() == 0) { 29 | //检查是否存在未缴费单子 30 | List medicalRecordList = medicalRecordRepository.findMedicalRecordByStatusAndHistoryGreaterThanAndPatientId(1, 1, medicalRecord.getPatientId()); 31 | if (medicalRecordList.size() != 0) { 32 | return true; 33 | } 34 | medicalRecord.setCreateDate(new Date()); 35 | } else { 36 | //设为已处理 37 | medicalRecord.setStatus(1); 38 | //是否病历 增加基础值 39 | int a = medicalRecord.getChecklistIdsArr() != null?medicalRecord.getChecklistIdsArr().length: 0; 40 | int b = medicalRecord.getPrescribeIdsArr() != null?medicalRecord.getPrescribeIdsArr().length: 0; 41 | medicalRecord.setHistory(a + b + 1); 42 | } 43 | medicalRecordRepository.save(medicalRecord); 44 | return true; 45 | } catch (Exception e) { 46 | System.out.println(e.getMessage()); 47 | return false; 48 | } 49 | } 50 | 51 | @Override 52 | public boolean updateHistory(int num, int recordId) { 53 | return medicalRecordRepository.updateHistory(num, recordId) > 0; 54 | } 55 | 56 | @Override 57 | public int getIdByUserId(int userId) { 58 | //检查是否存在未缴费单子 59 | List medicalRecordList = medicalRecordRepository.findMedicalRecordByStatusAndHistoryGreaterThanAndPatientId(1, 1, userId); 60 | if (medicalRecordList.size() == 0) { 61 | //获取未处理 62 | MedicalRecord medicalRecord = medicalRecordRepository.getFirstMedicalRecordByPatientIdAndStatus(userId, 0); 63 | if (medicalRecord != null) { 64 | return medicalRecord.getId(); 65 | } 66 | } 67 | return 0; 68 | } 69 | 70 | @Override 71 | public MedicalRecord getMedicalRecordById(int id) { 72 | MedicalRecord medicalRecord = medicalRecordRepository.findMedicalRecordByIdAndHistoryNot(id, 1); 73 | if (medicalRecord != null) { 74 | return getUserInfo(medicalRecord); 75 | } 76 | return null; 77 | } 78 | 79 | @Override 80 | public Page getMedicalRecordAllByPageAndStatusList(List statusList, int pageNumber, int pageSize) { 81 | Sort sort = Sort.by(Sort.Direction.ASC, "status"); 82 | return medicalRecordRepository.findMedicalRecordByStatusInAndHistoryNot(statusList, 1, PageRequest.of(pageNumber - 1, pageSize, sort)).map(this::getUserInfo); 83 | } 84 | 85 | @Override 86 | public MedicalRecord getRecordById(int id) { 87 | MedicalRecord medicalRecord = medicalRecordRepository.findMedicalRecordByIdAndHistoryEquals(id, 1); 88 | if (medicalRecord != null) { 89 | return getUserInfo(medicalRecord); 90 | } 91 | return null; 92 | } 93 | 94 | @Override 95 | public Page getRecordAllByPage(String userName, int pageNumber, int pageSize) { 96 | if (userName == null || userName.equals("")) { 97 | userName = "%%"; 98 | } else { 99 | userName = "%" + userName + "%"; 100 | } 101 | return medicalRecordRepository.findMedicalRecordByUserNamePageable(userName, 102 | PageRequest.of(pageNumber - 1, pageSize)) 103 | .map(this::getUserInfo); 104 | } 105 | 106 | @Override 107 | public List getMedicalRecordByPatientId(int patientId) { 108 | List medicalRecords = medicalRecordRepository.findMedicalRecordByPatientId(patientId); 109 | for (MedicalRecord record: medicalRecords) { 110 | record.setCreateDateName(DateUtils.formatYMDHMS(record.getCreateDate())); 111 | if (record.getChecklistIds() != null && !record.getChecklistIds().equals("")) { 112 | record.setChecklistIdsArr(record.getChecklistIds().split(",")); 113 | } 114 | if (record.getPrescribeIds() != null && !record.getPrescribeIds().equals("")) { 115 | record.setPrescribeIdsArr(record.getPrescribeIds().split(",")); 116 | } 117 | } 118 | return medicalRecords; 119 | } 120 | 121 | private MedicalRecord getUserInfo(MedicalRecord medicalRecord) { 122 | User userById = userRepository.findUserById(medicalRecord.getPatientId()); 123 | medicalRecord.setUserName(userById.getName()); 124 | medicalRecord.setPhone(userById.getPhone()); 125 | medicalRecord.setSexName(userById.getSex() == 1? "男": "女"); 126 | medicalRecord.setCreateDateName(DateUtils.formatYMDHMS(medicalRecord.getCreateDate())); 127 | if (medicalRecord.getPrescribeIds() != null && !medicalRecord.getPrescribeIds().equals("")) { 128 | medicalRecord.setPrescribeIdsArr(medicalRecord.getPrescribeIds().split(",")); 129 | } 130 | if (medicalRecord.getChecklistIds() != null && !medicalRecord.getChecklistIds().equals("")) { 131 | medicalRecord.setChecklistIdsArr(medicalRecord.getChecklistIds().split(",")); 132 | } 133 | return medicalRecord; 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /hospital-web/theme/footer.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | /* Element Chalk Variables */ 132 | /* Transition 133 | -------------------------- */ 134 | /* Color 135 | -------------------------- */ 136 | /* 53a8ff */ 137 | /* 66b1ff */ 138 | /* 79bbff */ 139 | /* 8cc5ff */ 140 | /* a0cfff */ 141 | /* b3d8ff */ 142 | /* c6e2ff */ 143 | /* d9ecff */ 144 | /* ecf5ff */ 145 | /* Link 146 | -------------------------- */ 147 | /* Border 148 | -------------------------- */ 149 | /* Fill 150 | -------------------------- */ 151 | /* Typography 152 | -------------------------- */ 153 | /* Size 154 | -------------------------- */ 155 | /* z-index 156 | -------------------------- */ 157 | /* Disable base 158 | -------------------------- */ 159 | /* Icon 160 | -------------------------- */ 161 | /* Checkbox 162 | -------------------------- */ 163 | /* Radio 164 | -------------------------- */ 165 | /* Select 166 | -------------------------- */ 167 | /* Alert 168 | -------------------------- */ 169 | /* MessageBox 170 | -------------------------- */ 171 | /* Message 172 | -------------------------- */ 173 | /* Notification 174 | -------------------------- */ 175 | /* Input 176 | -------------------------- */ 177 | /* Cascader 178 | -------------------------- */ 179 | /* Group 180 | -------------------------- */ 181 | /* Tab 182 | -------------------------- */ 183 | /* Button 184 | -------------------------- */ 185 | /* cascader 186 | -------------------------- */ 187 | /* Switch 188 | -------------------------- */ 189 | /* Dialog 190 | -------------------------- */ 191 | /* Table 192 | -------------------------- */ 193 | /* Pagination 194 | -------------------------- */ 195 | /* Popup 196 | -------------------------- */ 197 | /* Popover 198 | -------------------------- */ 199 | /* Tooltip 200 | -------------------------- */ 201 | /* Tag 202 | -------------------------- */ 203 | /* Tree 204 | -------------------------- */ 205 | /* Dropdown 206 | -------------------------- */ 207 | /* Badge 208 | -------------------------- */ 209 | /* Card 210 | --------------------------*/ 211 | /* Slider 212 | --------------------------*/ 213 | /* Steps 214 | --------------------------*/ 215 | /* Menu 216 | --------------------------*/ 217 | /* Rate 218 | --------------------------*/ 219 | /* DatePicker 220 | --------------------------*/ 221 | /* Loading 222 | --------------------------*/ 223 | /* Scrollbar 224 | --------------------------*/ 225 | /* Carousel 226 | --------------------------*/ 227 | /* Collapse 228 | --------------------------*/ 229 | /* Transfer 230 | --------------------------*/ 231 | /* Header 232 | --------------------------*/ 233 | /* Footer 234 | --------------------------*/ 235 | /* Main 236 | --------------------------*/ 237 | /* Timeline 238 | --------------------------*/ 239 | /* Backtop 240 | --------------------------*/ 241 | /* Link 242 | --------------------------*/ 243 | /* Calendar 244 | --------------------------*/ 245 | /* Form 246 | -------------------------- */ 247 | /* Avatar 248 | --------------------------*/ 249 | /* Break-point 250 | --------------------------*/ 251 | .el-footer { 252 | padding: 0 20px; 253 | -webkit-box-sizing: border-box; 254 | box-sizing: border-box; 255 | -ms-flex-negative: 0; 256 | flex-shrink: 0; } 257 | -------------------------------------------------------------------------------- /hospital-web/theme/header.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | /* Element Chalk Variables */ 132 | /* Transition 133 | -------------------------- */ 134 | /* Color 135 | -------------------------- */ 136 | /* 53a8ff */ 137 | /* 66b1ff */ 138 | /* 79bbff */ 139 | /* 8cc5ff */ 140 | /* a0cfff */ 141 | /* b3d8ff */ 142 | /* c6e2ff */ 143 | /* d9ecff */ 144 | /* ecf5ff */ 145 | /* Link 146 | -------------------------- */ 147 | /* Border 148 | -------------------------- */ 149 | /* Fill 150 | -------------------------- */ 151 | /* Typography 152 | -------------------------- */ 153 | /* Size 154 | -------------------------- */ 155 | /* z-index 156 | -------------------------- */ 157 | /* Disable base 158 | -------------------------- */ 159 | /* Icon 160 | -------------------------- */ 161 | /* Checkbox 162 | -------------------------- */ 163 | /* Radio 164 | -------------------------- */ 165 | /* Select 166 | -------------------------- */ 167 | /* Alert 168 | -------------------------- */ 169 | /* MessageBox 170 | -------------------------- */ 171 | /* Message 172 | -------------------------- */ 173 | /* Notification 174 | -------------------------- */ 175 | /* Input 176 | -------------------------- */ 177 | /* Cascader 178 | -------------------------- */ 179 | /* Group 180 | -------------------------- */ 181 | /* Tab 182 | -------------------------- */ 183 | /* Button 184 | -------------------------- */ 185 | /* cascader 186 | -------------------------- */ 187 | /* Switch 188 | -------------------------- */ 189 | /* Dialog 190 | -------------------------- */ 191 | /* Table 192 | -------------------------- */ 193 | /* Pagination 194 | -------------------------- */ 195 | /* Popup 196 | -------------------------- */ 197 | /* Popover 198 | -------------------------- */ 199 | /* Tooltip 200 | -------------------------- */ 201 | /* Tag 202 | -------------------------- */ 203 | /* Tree 204 | -------------------------- */ 205 | /* Dropdown 206 | -------------------------- */ 207 | /* Badge 208 | -------------------------- */ 209 | /* Card 210 | --------------------------*/ 211 | /* Slider 212 | --------------------------*/ 213 | /* Steps 214 | --------------------------*/ 215 | /* Menu 216 | --------------------------*/ 217 | /* Rate 218 | --------------------------*/ 219 | /* DatePicker 220 | --------------------------*/ 221 | /* Loading 222 | --------------------------*/ 223 | /* Scrollbar 224 | --------------------------*/ 225 | /* Carousel 226 | --------------------------*/ 227 | /* Collapse 228 | --------------------------*/ 229 | /* Transfer 230 | --------------------------*/ 231 | /* Header 232 | --------------------------*/ 233 | /* Footer 234 | --------------------------*/ 235 | /* Main 236 | --------------------------*/ 237 | /* Timeline 238 | --------------------------*/ 239 | /* Backtop 240 | --------------------------*/ 241 | /* Link 242 | --------------------------*/ 243 | /* Calendar 244 | --------------------------*/ 245 | /* Form 246 | -------------------------- */ 247 | /* Avatar 248 | --------------------------*/ 249 | /* Break-point 250 | --------------------------*/ 251 | .el-header { 252 | padding: 0 20px; 253 | -webkit-box-sizing: border-box; 254 | box-sizing: border-box; 255 | -ms-flex-negative: 0; 256 | flex-shrink: 0; } 257 | -------------------------------------------------------------------------------- /hospital-web/theme/timeline.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | /* Element Chalk Variables */ 132 | /* Transition 133 | -------------------------- */ 134 | /* Color 135 | -------------------------- */ 136 | /* 53a8ff */ 137 | /* 66b1ff */ 138 | /* 79bbff */ 139 | /* 8cc5ff */ 140 | /* a0cfff */ 141 | /* b3d8ff */ 142 | /* c6e2ff */ 143 | /* d9ecff */ 144 | /* ecf5ff */ 145 | /* Link 146 | -------------------------- */ 147 | /* Border 148 | -------------------------- */ 149 | /* Fill 150 | -------------------------- */ 151 | /* Typography 152 | -------------------------- */ 153 | /* Size 154 | -------------------------- */ 155 | /* z-index 156 | -------------------------- */ 157 | /* Disable base 158 | -------------------------- */ 159 | /* Icon 160 | -------------------------- */ 161 | /* Checkbox 162 | -------------------------- */ 163 | /* Radio 164 | -------------------------- */ 165 | /* Select 166 | -------------------------- */ 167 | /* Alert 168 | -------------------------- */ 169 | /* MessageBox 170 | -------------------------- */ 171 | /* Message 172 | -------------------------- */ 173 | /* Notification 174 | -------------------------- */ 175 | /* Input 176 | -------------------------- */ 177 | /* Cascader 178 | -------------------------- */ 179 | /* Group 180 | -------------------------- */ 181 | /* Tab 182 | -------------------------- */ 183 | /* Button 184 | -------------------------- */ 185 | /* cascader 186 | -------------------------- */ 187 | /* Switch 188 | -------------------------- */ 189 | /* Dialog 190 | -------------------------- */ 191 | /* Table 192 | -------------------------- */ 193 | /* Pagination 194 | -------------------------- */ 195 | /* Popup 196 | -------------------------- */ 197 | /* Popover 198 | -------------------------- */ 199 | /* Tooltip 200 | -------------------------- */ 201 | /* Tag 202 | -------------------------- */ 203 | /* Tree 204 | -------------------------- */ 205 | /* Dropdown 206 | -------------------------- */ 207 | /* Badge 208 | -------------------------- */ 209 | /* Card 210 | --------------------------*/ 211 | /* Slider 212 | --------------------------*/ 213 | /* Steps 214 | --------------------------*/ 215 | /* Menu 216 | --------------------------*/ 217 | /* Rate 218 | --------------------------*/ 219 | /* DatePicker 220 | --------------------------*/ 221 | /* Loading 222 | --------------------------*/ 223 | /* Scrollbar 224 | --------------------------*/ 225 | /* Carousel 226 | --------------------------*/ 227 | /* Collapse 228 | --------------------------*/ 229 | /* Transfer 230 | --------------------------*/ 231 | /* Header 232 | --------------------------*/ 233 | /* Footer 234 | --------------------------*/ 235 | /* Main 236 | --------------------------*/ 237 | /* Timeline 238 | --------------------------*/ 239 | /* Backtop 240 | --------------------------*/ 241 | /* Link 242 | --------------------------*/ 243 | /* Calendar 244 | --------------------------*/ 245 | /* Form 246 | -------------------------- */ 247 | /* Avatar 248 | --------------------------*/ 249 | /* Break-point 250 | --------------------------*/ 251 | .el-timeline { 252 | margin: 0; 253 | font-size: 14px; 254 | list-style: none; } 255 | .el-timeline .el-timeline-item:last-child .el-timeline-item__tail { 256 | display: none; } 257 | -------------------------------------------------------------------------------- /src/main/java/com/gak/hospital/controller/DoctorController.java: -------------------------------------------------------------------------------- 1 | package com.gak.hospital.controller; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.gak.hospital.entity.Checklist; 5 | import com.gak.hospital.entity.MedicalRecord; 6 | import com.gak.hospital.entity.Prescribe; 7 | import com.gak.hospital.service.*; 8 | import com.gak.hospital.utils.ResultUtils; 9 | import com.gak.hospital.utils.RoleUtils; 10 | import lombok.NonNull; 11 | import lombok.RequiredArgsConstructor; 12 | import org.springframework.http.HttpEntity; 13 | import org.springframework.http.ResponseEntity; 14 | import org.springframework.web.bind.annotation.*; 15 | 16 | import java.util.List; 17 | 18 | @RestController 19 | @RequestMapping("/doctor") 20 | @RequiredArgsConstructor 21 | public class DoctorController { 22 | 23 | private final @NonNull MedicalRecordService medicalRecordService; 24 | private final @NonNull ChecklistService checklistService; 25 | private final @NonNull PrescribeService prescribeService; 26 | private final @NonNull UserService userService; 27 | private final @NonNull MedicalService medicalService; 28 | 29 | 30 | /*****************************************挂号信息管理*****************************************/ 31 | @PostMapping("/record") 32 | public HttpEntity record(@RequestBody JSONObject object) { 33 | int pageNumber = object.getIntValue("pageNumber"); 34 | int visitNumber = object.getIntValue("visitNumber"); 35 | List statusList = JSONObject.parseArray(object.getString("statusList"), Integer.class); 36 | int pageSize = object.getIntValue("pageSize"); 37 | if (pageNumber > 0) { 38 | if (visitNumber == 0) { 39 | return ResponseEntity.ok(ResultUtils.pageToJson(medicalRecordService.getMedicalRecordAllByPageAndStatusList(statusList, pageNumber, pageSize))); 40 | } else { 41 | return ResponseEntity.ok(ResultUtils.entityToPageJson(medicalRecordService.getMedicalRecordById(visitNumber))); 42 | } 43 | } else { 44 | return ResponseEntity.badRequest().build(); 45 | } 46 | } 47 | 48 | /** 49 | * 获取全部医生 50 | * @return list 51 | */ 52 | @GetMapping("/doctorAll") 53 | public HttpEntity doctorAll() { 54 | return ResponseEntity.ok(userService.getAllByRole(RoleUtils.ROLE_DOCTOR)); 55 | } 56 | 57 | /** 58 | * 获取全部医技 59 | * @return list 60 | */ 61 | @GetMapping("/medicalAll") 62 | public HttpEntity medicalAll() { 63 | return ResponseEntity.ok(medicalService.getAll()); 64 | } 65 | 66 | /** 67 | * 根据id获取处方 68 | */ 69 | @PostMapping("/getPrescribe") 70 | public HttpEntity getPrescribe(@RequestBody JSONObject object) { 71 | return ResponseEntity.ok(prescribeService.getPrescribeById(object.getIntValue("id"))); 72 | } 73 | 74 | /** 75 | * 根据id获取检查单 76 | */ 77 | @PostMapping("/getChecklist") 78 | public HttpEntity getChecklist(@RequestBody JSONObject object) { 79 | return ResponseEntity.ok(checklistService.getChecklistById(object.getIntValue("id"))); 80 | } 81 | 82 | /** 83 | * 添加更新检查单 84 | * 同时保存到挂号信息里 85 | */ 86 | @PostMapping("/checklistAddOrUpdate") 87 | public HttpEntity checklistAddOrUpdate(@RequestBody JSONObject object) { 88 | Checklist checklist = object.toJavaObject(Checklist.class); 89 | if (checklist != null && checklist.getVisitNumber() != 0 && checklistService.addOrUpdate(checklist)) { 90 | return ResponseEntity.ok(medicalRecordService.getMedicalRecordById(checklist.getVisitNumber())); 91 | } 92 | return ResponseEntity.badRequest().build(); 93 | } 94 | 95 | /** 96 | * 添加更新处方 97 | * 同时保存到挂号信息里 98 | */ 99 | @PostMapping("/prescribeAddOrUpdate") 100 | public HttpEntity prescribeAddOrUpdate(@RequestBody JSONObject object) { 101 | Prescribe prescribe = object.toJavaObject(Prescribe.class); 102 | if (prescribe != null && prescribe.getVisitNumber() != 0 && prescribeService.addOrUpdate(prescribe)) { 103 | return ResponseEntity.ok(medicalRecordService.getMedicalRecordById(prescribe.getVisitNumber())); 104 | } 105 | return ResponseEntity.badRequest().build(); 106 | } 107 | 108 | /** 109 | * 删除检查单 110 | * 同时保存到挂号信息里 111 | */ 112 | @PostMapping("/checklistDel") 113 | public HttpEntity checklistDel(@RequestBody JSONObject object) { 114 | return ResponseEntity.ok(checklistService.delChecklistById(object.getIntValue("id"))); 115 | } 116 | 117 | /** 118 | * 删除处方 119 | * 同时保存到挂号信息里 120 | */ 121 | @PostMapping("/prescribeDel") 122 | public HttpEntity prescribeDel(@RequestBody JSONObject object) { 123 | return ResponseEntity.ok(prescribeService.delPrescribeById(object.getIntValue("id"))); 124 | } 125 | 126 | /** 127 | * 更新挂号信息 128 | * @param object form 129 | */ 130 | @PostMapping("/recordUpdate") 131 | public HttpEntity recordUpdate(@RequestBody JSONObject object) { 132 | MedicalRecord medicalRecord = object.toJavaObject(MedicalRecord.class); 133 | if (medicalRecord != null && medicalRecord.getId() != 0) { 134 | return ResponseEntity.ok(medicalRecordService.saveOrUpdate(medicalRecord)); 135 | } 136 | return ResponseEntity.badRequest().build(); 137 | } 138 | 139 | /*****************************************病历管理*****************************************/ 140 | @PostMapping("/medicalRecord") 141 | public HttpEntity medicalRecord(@RequestBody JSONObject object) { 142 | int pageNumber = object.getIntValue("pageNumber"); 143 | String userName = object.getString("userName"); 144 | int pageSize = object.getIntValue("pageSize"); 145 | int visitNumber = object.getIntValue("visitNumber"); 146 | if (pageNumber > 0) { 147 | if (visitNumber == 0) { 148 | return ResponseEntity.ok(ResultUtils.pageToJson(medicalRecordService.getRecordAllByPage(userName, pageNumber, pageSize))); 149 | } else { 150 | return ResponseEntity.ok(ResultUtils.entityToPageJson(medicalRecordService.getRecordById(visitNumber))); 151 | } 152 | } else { 153 | return ResponseEntity.badRequest().build(); 154 | } 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /hospital-web/theme/main.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | /* Element Chalk Variables */ 132 | /* Transition 133 | -------------------------- */ 134 | /* Color 135 | -------------------------- */ 136 | /* 53a8ff */ 137 | /* 66b1ff */ 138 | /* 79bbff */ 139 | /* 8cc5ff */ 140 | /* a0cfff */ 141 | /* b3d8ff */ 142 | /* c6e2ff */ 143 | /* d9ecff */ 144 | /* ecf5ff */ 145 | /* Link 146 | -------------------------- */ 147 | /* Border 148 | -------------------------- */ 149 | /* Fill 150 | -------------------------- */ 151 | /* Typography 152 | -------------------------- */ 153 | /* Size 154 | -------------------------- */ 155 | /* z-index 156 | -------------------------- */ 157 | /* Disable base 158 | -------------------------- */ 159 | /* Icon 160 | -------------------------- */ 161 | /* Checkbox 162 | -------------------------- */ 163 | /* Radio 164 | -------------------------- */ 165 | /* Select 166 | -------------------------- */ 167 | /* Alert 168 | -------------------------- */ 169 | /* MessageBox 170 | -------------------------- */ 171 | /* Message 172 | -------------------------- */ 173 | /* Notification 174 | -------------------------- */ 175 | /* Input 176 | -------------------------- */ 177 | /* Cascader 178 | -------------------------- */ 179 | /* Group 180 | -------------------------- */ 181 | /* Tab 182 | -------------------------- */ 183 | /* Button 184 | -------------------------- */ 185 | /* cascader 186 | -------------------------- */ 187 | /* Switch 188 | -------------------------- */ 189 | /* Dialog 190 | -------------------------- */ 191 | /* Table 192 | -------------------------- */ 193 | /* Pagination 194 | -------------------------- */ 195 | /* Popup 196 | -------------------------- */ 197 | /* Popover 198 | -------------------------- */ 199 | /* Tooltip 200 | -------------------------- */ 201 | /* Tag 202 | -------------------------- */ 203 | /* Tree 204 | -------------------------- */ 205 | /* Dropdown 206 | -------------------------- */ 207 | /* Badge 208 | -------------------------- */ 209 | /* Card 210 | --------------------------*/ 211 | /* Slider 212 | --------------------------*/ 213 | /* Steps 214 | --------------------------*/ 215 | /* Menu 216 | --------------------------*/ 217 | /* Rate 218 | --------------------------*/ 219 | /* DatePicker 220 | --------------------------*/ 221 | /* Loading 222 | --------------------------*/ 223 | /* Scrollbar 224 | --------------------------*/ 225 | /* Carousel 226 | --------------------------*/ 227 | /* Collapse 228 | --------------------------*/ 229 | /* Transfer 230 | --------------------------*/ 231 | /* Header 232 | --------------------------*/ 233 | /* Footer 234 | --------------------------*/ 235 | /* Main 236 | --------------------------*/ 237 | /* Timeline 238 | --------------------------*/ 239 | /* Backtop 240 | --------------------------*/ 241 | /* Link 242 | --------------------------*/ 243 | /* Calendar 244 | --------------------------*/ 245 | /* Form 246 | -------------------------- */ 247 | /* Avatar 248 | --------------------------*/ 249 | /* Break-point 250 | --------------------------*/ 251 | .el-main { 252 | display: block; 253 | -webkit-box-flex: 1; 254 | -ms-flex: 1; 255 | flex: 1; 256 | -ms-flex-preferred-size: auto; 257 | flex-basis: auto; 258 | overflow: auto; 259 | -webkit-box-sizing: border-box; 260 | box-sizing: border-box; 261 | padding: 20px; } 262 | -------------------------------------------------------------------------------- /hospital-web/theme/popconfirm.css: -------------------------------------------------------------------------------- 1 | /* BEM support Func 2 | -------------------------- */ 3 | /* Element Chalk Variables */ 4 | /* Transition 5 | -------------------------- */ 6 | /* Color 7 | -------------------------- */ 8 | /* 53a8ff */ 9 | /* 66b1ff */ 10 | /* 79bbff */ 11 | /* 8cc5ff */ 12 | /* a0cfff */ 13 | /* b3d8ff */ 14 | /* c6e2ff */ 15 | /* d9ecff */ 16 | /* ecf5ff */ 17 | /* Link 18 | -------------------------- */ 19 | /* Border 20 | -------------------------- */ 21 | /* Fill 22 | -------------------------- */ 23 | /* Typography 24 | -------------------------- */ 25 | /* Size 26 | -------------------------- */ 27 | /* z-index 28 | -------------------------- */ 29 | /* Disable base 30 | -------------------------- */ 31 | /* Icon 32 | -------------------------- */ 33 | /* Checkbox 34 | -------------------------- */ 35 | /* Radio 36 | -------------------------- */ 37 | /* Select 38 | -------------------------- */ 39 | /* Alert 40 | -------------------------- */ 41 | /* MessageBox 42 | -------------------------- */ 43 | /* Message 44 | -------------------------- */ 45 | /* Notification 46 | -------------------------- */ 47 | /* Input 48 | -------------------------- */ 49 | /* Cascader 50 | -------------------------- */ 51 | /* Group 52 | -------------------------- */ 53 | /* Tab 54 | -------------------------- */ 55 | /* Button 56 | -------------------------- */ 57 | /* cascader 58 | -------------------------- */ 59 | /* Switch 60 | -------------------------- */ 61 | /* Dialog 62 | -------------------------- */ 63 | /* Table 64 | -------------------------- */ 65 | /* Pagination 66 | -------------------------- */ 67 | /* Popup 68 | -------------------------- */ 69 | /* Popover 70 | -------------------------- */ 71 | /* Tooltip 72 | -------------------------- */ 73 | /* Tag 74 | -------------------------- */ 75 | /* Tree 76 | -------------------------- */ 77 | /* Dropdown 78 | -------------------------- */ 79 | /* Badge 80 | -------------------------- */ 81 | /* Card 82 | --------------------------*/ 83 | /* Slider 84 | --------------------------*/ 85 | /* Steps 86 | --------------------------*/ 87 | /* Menu 88 | --------------------------*/ 89 | /* Rate 90 | --------------------------*/ 91 | /* DatePicker 92 | --------------------------*/ 93 | /* Loading 94 | --------------------------*/ 95 | /* Scrollbar 96 | --------------------------*/ 97 | /* Carousel 98 | --------------------------*/ 99 | /* Collapse 100 | --------------------------*/ 101 | /* Transfer 102 | --------------------------*/ 103 | /* Header 104 | --------------------------*/ 105 | /* Footer 106 | --------------------------*/ 107 | /* Main 108 | --------------------------*/ 109 | /* Timeline 110 | --------------------------*/ 111 | /* Backtop 112 | --------------------------*/ 113 | /* Link 114 | --------------------------*/ 115 | /* Calendar 116 | --------------------------*/ 117 | /* Form 118 | -------------------------- */ 119 | /* Avatar 120 | --------------------------*/ 121 | /* Break-point 122 | --------------------------*/ 123 | /* Break-points 124 | -------------------------- */ 125 | /* Scrollbar 126 | -------------------------- */ 127 | /* Placeholder 128 | -------------------------- */ 129 | /* BEM 130 | -------------------------- */ 131 | /* Element Chalk Variables */ 132 | /* Transition 133 | -------------------------- */ 134 | /* Color 135 | -------------------------- */ 136 | /* 53a8ff */ 137 | /* 66b1ff */ 138 | /* 79bbff */ 139 | /* 8cc5ff */ 140 | /* a0cfff */ 141 | /* b3d8ff */ 142 | /* c6e2ff */ 143 | /* d9ecff */ 144 | /* ecf5ff */ 145 | /* Link 146 | -------------------------- */ 147 | /* Border 148 | -------------------------- */ 149 | /* Fill 150 | -------------------------- */ 151 | /* Typography 152 | -------------------------- */ 153 | /* Size 154 | -------------------------- */ 155 | /* z-index 156 | -------------------------- */ 157 | /* Disable base 158 | -------------------------- */ 159 | /* Icon 160 | -------------------------- */ 161 | /* Checkbox 162 | -------------------------- */ 163 | /* Radio 164 | -------------------------- */ 165 | /* Select 166 | -------------------------- */ 167 | /* Alert 168 | -------------------------- */ 169 | /* MessageBox 170 | -------------------------- */ 171 | /* Message 172 | -------------------------- */ 173 | /* Notification 174 | -------------------------- */ 175 | /* Input 176 | -------------------------- */ 177 | /* Cascader 178 | -------------------------- */ 179 | /* Group 180 | -------------------------- */ 181 | /* Tab 182 | -------------------------- */ 183 | /* Button 184 | -------------------------- */ 185 | /* cascader 186 | -------------------------- */ 187 | /* Switch 188 | -------------------------- */ 189 | /* Dialog 190 | -------------------------- */ 191 | /* Table 192 | -------------------------- */ 193 | /* Pagination 194 | -------------------------- */ 195 | /* Popup 196 | -------------------------- */ 197 | /* Popover 198 | -------------------------- */ 199 | /* Tooltip 200 | -------------------------- */ 201 | /* Tag 202 | -------------------------- */ 203 | /* Tree 204 | -------------------------- */ 205 | /* Dropdown 206 | -------------------------- */ 207 | /* Badge 208 | -------------------------- */ 209 | /* Card 210 | --------------------------*/ 211 | /* Slider 212 | --------------------------*/ 213 | /* Steps 214 | --------------------------*/ 215 | /* Menu 216 | --------------------------*/ 217 | /* Rate 218 | --------------------------*/ 219 | /* DatePicker 220 | --------------------------*/ 221 | /* Loading 222 | --------------------------*/ 223 | /* Scrollbar 224 | --------------------------*/ 225 | /* Carousel 226 | --------------------------*/ 227 | /* Collapse 228 | --------------------------*/ 229 | /* Transfer 230 | --------------------------*/ 231 | /* Header 232 | --------------------------*/ 233 | /* Footer 234 | --------------------------*/ 235 | /* Main 236 | --------------------------*/ 237 | /* Timeline 238 | --------------------------*/ 239 | /* Backtop 240 | --------------------------*/ 241 | /* Link 242 | --------------------------*/ 243 | /* Calendar 244 | --------------------------*/ 245 | /* Form 246 | -------------------------- */ 247 | /* Avatar 248 | --------------------------*/ 249 | /* Break-point 250 | --------------------------*/ 251 | .el-popconfirm__main { 252 | display: -webkit-box; 253 | display: -ms-flexbox; 254 | display: flex; 255 | -webkit-box-align: center; 256 | -ms-flex-align: center; 257 | align-items: center; } 258 | 259 | .el-popconfirm__icon { 260 | margin-right: 5px; } 261 | 262 | .el-popconfirm__action { 263 | text-align: right; 264 | margin: 0; } 265 | --------------------------------------------------------------------------------