├── .gitattributes ├── .gitignore ├── README.md ├── drug-vue ├── .gitignore ├── babel.config.js ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── App.vue │ ├── assets │ │ ├── 404_images │ │ │ ├── 403.jpg │ │ │ ├── 404.jpg │ │ │ ├── 404.png │ │ │ ├── 404_cloud.png │ │ │ └── 500.jpg │ │ └── theme-icon.png │ ├── components │ │ ├── headNav.vue │ │ └── leftSide.vue │ ├── http.js │ ├── js │ │ ├── customer │ │ │ └── customerTypeList.js │ │ ├── dbBackLog │ │ │ └── list.js │ │ ├── drug │ │ │ ├── list.js │ │ │ └── typeList.js │ │ ├── goods │ │ │ └── list.js │ │ ├── goodsStorage │ │ │ └── list.js │ │ ├── goodsStorageLog │ │ │ └── list.js │ │ ├── index │ │ │ └── index.js │ │ ├── login │ │ │ └── login.js │ │ ├── permission │ │ │ └── list.js │ │ ├── register │ │ │ └── list.js │ │ ├── role │ │ │ └── list.js │ │ ├── roomSend │ │ │ └── list.js │ │ ├── roomStorage │ │ │ └── list.js │ │ ├── roomStorageLog │ │ │ └── list.js │ │ ├── storage │ │ │ └── list.js │ │ ├── storageLog │ │ │ └── list.js │ │ ├── user │ │ │ └── list.js │ │ └── userLoginLog │ │ │ └── list.js │ ├── main.js │ ├── router │ │ └── index.js │ ├── store │ │ └── index.js │ ├── styles │ │ └── reset.css │ └── views │ │ ├── login │ │ └── index.vue │ │ ├── permission │ │ └── permission.js │ │ ├── register │ │ └── list.vue │ │ ├── roomSend │ │ └── list.vue │ │ ├── roomStorage │ │ └── list.vue │ │ ├── roomStorageLog │ │ └── list.vue │ │ ├── storage │ │ └── list.vue │ │ └── storageLog │ │ └── list.vue └── vue.config.js ├── drug ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── drug │ │ │ ├── Application.java │ │ │ ├── api │ │ │ ├── APIResult.java │ │ │ ├── ResultCode.java │ │ │ ├── ResultSupport.java │ │ │ ├── request │ │ │ │ ├── BaseRequest.java │ │ │ │ └── BaseResponse.java │ │ │ └── response │ │ │ │ ├── CommonPageRequest.java │ │ │ │ └── CommonPageResponse.java │ │ │ ├── common │ │ │ └── Constant.java │ │ │ ├── config │ │ │ ├── ConfigBeanValue.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── TransactionAdviceConfig.java │ │ │ ├── filter │ │ │ │ ├── CorsConfig.java │ │ │ │ └── MyWebFilter.java │ │ │ └── secure │ │ │ │ ├── MyAuthenticationDetailsSource.java │ │ │ │ ├── MyUserDetailsService.java │ │ │ │ ├── MyWebAuthenticationDetails.java │ │ │ │ ├── RbacService.java │ │ │ │ ├── RbacServiceImpl.java │ │ │ │ └── WebSecurityConfig.java │ │ │ ├── dao │ │ │ ├── customer │ │ │ │ └── CustomerTypeMapper.java │ │ │ ├── db │ │ │ │ └── DBMapper.java │ │ │ ├── drug │ │ │ │ ├── DrugMapper.java │ │ │ │ └── DrugTypeMapper.java │ │ │ ├── goods │ │ │ │ ├── GoodsMapper.java │ │ │ │ ├── GoodsStorageLogMapper.java │ │ │ │ └── GoodsStorageMapper.java │ │ │ ├── register │ │ │ │ └── RegisterMapper.java │ │ │ ├── room │ │ │ │ ├── RoomSendMapper.java │ │ │ │ ├── RoomStorageLogMapper.java │ │ │ │ └── RoomStorageMapper.java │ │ │ ├── storage │ │ │ │ ├── StorageLogMapper.java │ │ │ │ └── StorageMapper.java │ │ │ └── user │ │ │ │ ├── PermissionMapper.java │ │ │ │ ├── RoleMapper.java │ │ │ │ ├── RolePermissionMapper.java │ │ │ │ ├── UserLoginLogMapper.java │ │ │ │ ├── UserMapper.java │ │ │ │ └── UserRoleMapper.java │ │ │ ├── entity │ │ │ ├── DBBackLog.java │ │ │ ├── IdEntity.java │ │ │ ├── customer │ │ │ │ └── CustomerType.java │ │ │ ├── drug │ │ │ │ ├── Drug.java │ │ │ │ └── DrugType.java │ │ │ ├── enums │ │ │ │ └── BaseEnum.java │ │ │ ├── goods │ │ │ │ ├── Goods.java │ │ │ │ ├── GoodsOperatorTypeEnum.java │ │ │ │ ├── GoodsStorage.java │ │ │ │ └── GoodsStorageLog.java │ │ │ ├── register │ │ │ │ └── Register.java │ │ │ ├── room │ │ │ │ ├── RoomOperatorTypeEnum.java │ │ │ │ ├── RoomSend.java │ │ │ │ ├── RoomStorage.java │ │ │ │ └── RoomStorageLog.java │ │ │ ├── storage │ │ │ │ ├── DrugStorage.java │ │ │ │ ├── DrugStorageLog.java │ │ │ │ └── StorageOperatorTypeEnum.java │ │ │ └── user │ │ │ │ ├── Permission.java │ │ │ │ ├── Role.java │ │ │ │ ├── RolePermission.java │ │ │ │ ├── User.java │ │ │ │ ├── UserLoginLog.java │ │ │ │ └── UserRole.java │ │ │ ├── service │ │ │ ├── customer │ │ │ │ ├── CustomerTypeService.java │ │ │ │ └── impl │ │ │ │ │ └── CustomerTypeServiceImpl.java │ │ │ ├── db │ │ │ │ ├── DBService.java │ │ │ │ └── impl │ │ │ │ │ └── DBServiceImpl.java │ │ │ ├── drug │ │ │ │ ├── DrugService.java │ │ │ │ ├── DrugTypeService.java │ │ │ │ └── impl │ │ │ │ │ ├── DrugServiceImpl.java │ │ │ │ │ └── DrugTypeServiceImpl.java │ │ │ ├── goods │ │ │ │ ├── GoodsService.java │ │ │ │ ├── GoodsStorageLogService.java │ │ │ │ ├── GoodsStorageService.java │ │ │ │ └── impl │ │ │ │ │ ├── GoodsServiceImpl.java │ │ │ │ │ ├── GoodsStorageLogServiceImpl.java │ │ │ │ │ └── GoodsStorageServiceImpl.java │ │ │ ├── register │ │ │ │ ├── RegisterService.java │ │ │ │ └── impl │ │ │ │ │ └── RegisterServiceImpl.java │ │ │ ├── room │ │ │ │ ├── RoomSendService.java │ │ │ │ ├── RoomStorageLogService.java │ │ │ │ ├── RoomStorageService.java │ │ │ │ └── impl │ │ │ │ │ ├── RoomSendServiceImpl.java │ │ │ │ │ ├── RoomStorageLogServiceImpl.java │ │ │ │ │ └── RoomStorageServiceImpl.java │ │ │ ├── storage │ │ │ │ ├── StorageLogService.java │ │ │ │ ├── StorageService.java │ │ │ │ └── impl │ │ │ │ │ ├── StorageLogServiceImpl.java │ │ │ │ │ └── StorageServiceImpl.java │ │ │ └── user │ │ │ │ ├── PermissionService.java │ │ │ │ ├── RolePermissionService.java │ │ │ │ ├── RoleService.java │ │ │ │ ├── UserLoginLogService.java │ │ │ │ ├── UserService.java │ │ │ │ └── impl │ │ │ │ ├── PermissionServiceImpl.java │ │ │ │ ├── RolePermissionServiceImpl.java │ │ │ │ ├── RoleServiceImpl.java │ │ │ │ ├── UserLoginLogServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ ├── utils │ │ │ ├── Collections.java │ │ │ └── UserUtil.java │ │ │ └── web │ │ │ ├── common │ │ │ └── BaseCtrl.java │ │ │ ├── customer │ │ │ └── CustomerTypeCtrl.java │ │ │ ├── db │ │ │ └── DbCtrl.java │ │ │ ├── drug │ │ │ ├── DrugCtrl.java │ │ │ ├── DrugTypeCtrl.java │ │ │ ├── request │ │ │ │ └── DrugRequest.java │ │ │ └── response │ │ │ │ └── DrugResponse.java │ │ │ ├── goods │ │ │ ├── GoodsCtrl.java │ │ │ ├── GoodsStorageCtrl.java │ │ │ ├── GoodsStorageLogCtrl.java │ │ │ ├── request │ │ │ │ ├── GoodsRequest.java │ │ │ │ ├── GoodsStorageLogSearchParamRequest.java │ │ │ │ └── GoodsStorageSearchParamRequest.java │ │ │ └── response │ │ │ │ ├── GoodsResponse.java │ │ │ │ └── GoodsStorageOperatorTypeEnumResponse.java │ │ │ ├── nacos │ │ │ └── ConfigController.java │ │ │ ├── register │ │ │ ├── RegisterCtrl.java │ │ │ ├── request │ │ │ │ └── RegisterRequest.java │ │ │ └── response │ │ │ │ └── RegisterResponse.java │ │ │ ├── room │ │ │ ├── RoomSendCtrl.java │ │ │ ├── RoomStorageCtrl.java │ │ │ ├── RoomStorageLogCtrl.java │ │ │ ├── request │ │ │ │ ├── RoomSendRequest.java │ │ │ │ ├── RoomSendSearchParamRequest.java │ │ │ │ ├── RoomStorageLogSearchParamRequest.java │ │ │ │ └── RoomStorageSearchParamRequest.java │ │ │ └── response │ │ │ │ └── RoomStorageOperatorTypeEnumResponse.java │ │ │ ├── storage │ │ │ ├── StorageCtrl.java │ │ │ ├── StorageLogCtrl.java │ │ │ ├── request │ │ │ │ ├── StorageLogSearchParamRequest.java │ │ │ │ └── StorageSearchParamRequest.java │ │ │ └── response │ │ │ │ ├── StorageChartsResponse.java │ │ │ │ └── StorageOperatorTypeEnumResponse.java │ │ │ └── user │ │ │ ├── PermissionCtrl.java │ │ │ ├── RoleCtrl.java │ │ │ ├── UserCtrl.java │ │ │ ├── request │ │ │ ├── PermissionRequest.java │ │ │ ├── RolePermissionRequest.java │ │ │ ├── RoleRequest.java │ │ │ ├── UserCheckNameRequest.java │ │ │ ├── UserPasswordRequest.java │ │ │ ├── UserRequest.java │ │ │ └── UserThemeRequest.java │ │ │ └── response │ │ │ ├── PermissionParentResponse.java │ │ │ ├── PermissionResponse.java │ │ │ ├── PermissionTotalResponse.java │ │ │ ├── RolePermissionResponse.java │ │ │ ├── UserFromResponse.java │ │ │ └── UserResponse.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ ├── CodeReviewTest.java │ └── com │ └── NewCodeReviewTest.java └── picture ├── picture1.png ├── picture10.png ├── picture11.png ├── picture12.png ├── picture13.png ├── picture14.png ├── picture15.png ├── picture16.png ├── picture17.png ├── picture18.png ├── picture19.png ├── picture2.png ├── picture20.png ├── picture21.png ├── picture22.png ├── picture23.png ├── picture3.png ├── picture4.png ├── picture5.png ├── picture6.png ├── picture7.png ├── picture8.png └── picture9.png /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | *.css linguist-language=java 3 | *.html linguist-language=java 4 | *.vue linguist-language=java 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /out/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | *.zip 4 | *.docs 5 | /drug/target/ 6 | /drug-vue/node_modules/ 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 | .mvn 22 | mvnw 23 | mvnw.cmd 24 | 25 | ### NetBeans ### 26 | /nbproject/private/ 27 | /build/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 基于Java+Springboot+vue的药店管理系统(源码+数据库)103 2 | 3 | ## 一、系统介绍 4 | 本系统前后端分离 5 | 6 | -功能: 7 | 登录、药库药品管理、统计查询、药房管理、物资管理、挂号管理、账号管理、角色管理、权限管理、登录日志管理、药品管理、药品类型管理、客人类型管理 8 | 9 | 10 | ## 二、所用技术 11 | 后端技术栈: 12 | - Springboot 13 | - SpringMvc 14 | - mybatisPlus 15 | - mysql 16 | - SpringSecurity 17 | 18 | 前端技术栈: 19 | - Vue 20 | - ElementUI 21 | - vue-router 22 | - axios 23 | 24 | ## 三、环境介绍 25 | 基础环境 :IDEA/eclipse, JDK 1.8, Mysql5.7及以上, Maven3.6, node.js(14版本) 26 | 27 | 所有项目以及源代码本人均调试运行无问题 可支持远程调试运行 28 | 29 | ## 四、页面截图 30 | ### 1、功能页面 31 | ![contents](./picture/picture1.png) 32 | ![contents](./picture/picture2.png) 33 | ![contents](./picture/picture3.png) 34 | ![contents](./picture/picture4.png) 35 | ![contents](./picture/picture5.png) 36 | ![contents](./picture/picture6.png) 37 | ![contents](./picture/picture7.png) 38 | ![contents](./picture/picture8.png) 39 | ![contents](./picture/picture9.png) 40 | ![contents](./picture/picture10.png) 41 | ![contents](./picture/picture11.png) 42 | ![contents](./picture/picture12.png) 43 | ![contents](./picture/picture13.png) 44 | ![contents](./picture/picture14.png) 45 | ![contents](./picture/picture15.png) 46 | ![contents](./picture/picture16.png) 47 | ![contents](./picture/picture17.png) 48 | ![contents](./picture/picture18.png) 49 | ![contents](./picture/picture19.png) 50 | ![contents](./picture/picture20.png) 51 | ![contents](./picture/picture21.png) 52 | ![contents](./picture/picture22.png) 53 | ![contents](./picture/picture23.png) 54 | 55 | ## 五、浏览地址 56 | - 前台访问路径:http://localhost:8889 57 | 账号密码:admin/123456 58 | 59 | ## 六、安装教程 60 | 61 | 1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并执行项目的sql 62 | 63 | 2. 使用IDEA/Eclipse导入drug项目,导入时,若为maven项目请选择maven; 等待依赖下载完成 64 | 65 | 3. 修改resources目录下面application.properties里面的数据库配置和文件路径配置 66 | 67 | 4. com/drug/Application.java启动后端项目 68 | 69 | 5. vscode或idea打开drug-vue项目 70 | 71 | 6. 在编译器中打开terminal,执行npm install 依赖下载完成后执行 npm run serve,执行成功后会显示前台访问地址 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /drug-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /drug-vue/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /drug-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "drug", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.21.1", 11 | "core-js": "^3.6.5", 12 | "echarts": "^4.9.0", 13 | "element-ui": "^2.13.2", 14 | "v-charts": "^1.19.0", 15 | "v-echarts": "^1.0.2", 16 | "vue": "^2.6.11", 17 | "vue-particles": "^1.0.9", 18 | "vue-router": "^3.2.0", 19 | "vuex": "^3.4.0", 20 | "vuex-persistedstate": "^4.0.0-beta.1" 21 | }, 22 | "devDependencies": { 23 | "@vue/cli-plugin-babel": "~4.5.0", 24 | "@vue/cli-plugin-router": "~4.5.0", 25 | "@vue/cli-plugin-vuex": "~4.5.0", 26 | "@vue/cli-service": "~4.5.0", 27 | "node-loader": "^1.0.2", 28 | "node-sass": "^5.0.0", 29 | "sass-loader": "^10.1.0", 30 | "vue-template-compiler": "^2.6.11" 31 | }, 32 | "browserslist": [ 33 | "> 1%", 34 | "last 2 versions", 35 | "not dead" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /drug-vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/public/favicon.ico -------------------------------------------------------------------------------- /drug-vue/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /drug-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | 25 | -------------------------------------------------------------------------------- /drug-vue/src/assets/404_images/403.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/403.jpg -------------------------------------------------------------------------------- /drug-vue/src/assets/404_images/404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/404.jpg -------------------------------------------------------------------------------- /drug-vue/src/assets/404_images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/404.png -------------------------------------------------------------------------------- /drug-vue/src/assets/404_images/404_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/404_cloud.png -------------------------------------------------------------------------------- /drug-vue/src/assets/404_images/500.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/500.jpg -------------------------------------------------------------------------------- /drug-vue/src/assets/theme-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/theme-icon.png -------------------------------------------------------------------------------- /drug-vue/src/http.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import router from './router' 3 | const url = 'http://localhost:8888'/*设置全局请求地址*/ 4 | 5 | 6 | //请求拦截 7 | axios.interceptors.request.use(config => { 8 | if (config.url.indexOf(url) === -1) { 9 | config.url = url + config.url; /*拼接完整请求路径*/ 10 | } 11 | if (config.url.indexOf("login") == -1) { 12 | const token = localStorage.getItem("auth-token"); 13 | config.headers['auth-token'] = token /*设置统一请求头*/ 14 | } 15 | return config 16 | }, error => { 17 | return Promise.reject(error) 18 | }); 19 | 20 | //响应拦截 21 | axios.interceptors.response.use( 22 | response => { 23 | return response; 24 | }, 25 | error => { 26 | const { status } = error.response; 27 | console.log(status); 28 | switch (status) { 29 | case 401: 30 | localStorage.removeItem('auth-token'); //清除token 31 | router.replace('/login')//跳转登陆页面 32 | break; 33 | case 403: 34 | router.replace('/error/403') 35 | break; 36 | case 500: 37 | router.replace('/error/500') 38 | break; 39 | case 404: 40 | router.replace('/error/404') 41 | break; 42 | default: 43 | router.replace('/error/500') 44 | break; 45 | } 46 | return Promise.reject(error) 47 | } 48 | ); 49 | 50 | export default axios; 51 | 52 | 53 | -------------------------------------------------------------------------------- /drug-vue/src/js/customer/customerTypeList.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "customerTypeList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | dialog: { 13 | title: "", 14 | show: false, 15 | }, 16 | newForm: { 17 | }, 18 | rules: { 19 | name: [{ required: true, message: "请输入类型", trigger: "blur" }], 20 | }, 21 | data: [], 22 | }; 23 | }, 24 | created() { 25 | this.createParams(); 26 | }, 27 | methods: { 28 | //初始化数据 29 | createParams() { 30 | //加载列表 31 | this.$axios 32 | .post("/customerType/list/page/", this.queryinfo) 33 | .then((res) => { 34 | if (res.data != null && res.data != "") { 35 | this.tableData = res.data.records; 36 | this.total = res.data.total; 37 | } else { 38 | this.$message.error("获取列表失败!"); 39 | } 40 | }) 41 | .catch((err) => { 42 | console.log("报错了" + err); 43 | }); 44 | }, 45 | //展开新建弹框 46 | newObj() { 47 | this.dialog = { 48 | title: "新建客人类型", 49 | show: true, 50 | }; 51 | }, 52 | 53 | //展开编辑弹框 54 | edit(id) { 55 | this.dialog = { 56 | title: "编辑客人类型", 57 | show: true, 58 | }; 59 | this.$axios 60 | .get("/customerType/loadDetail/" + id + "/") 61 | .then((res) => { 62 | this.newForm = res.data; 63 | }) 64 | .catch((err) => { 65 | console.log("报错了" + err); 66 | }); 67 | }, 68 | //保存弹框 69 | submitForm(formName) { 70 | this.$refs[formName].validate((valid) => { 71 | if (valid) { 72 | this.$axios 73 | .post("/customerType/save/", this.newForm) 74 | .then((res) => { 75 | if (res.data != null && res.data != "") { 76 | this.$message({ 77 | type: "success", 78 | message: "保存成功!", 79 | }); 80 | this.dialog.show = false; 81 | this.createParams(); 82 | } else { 83 | this.$message.error("保存失败!"); 84 | } 85 | }) 86 | .catch((err) => { 87 | console.log("报错了" + err); 88 | }); 89 | } else { 90 | console.log("error submit!"); 91 | return false; 92 | } 93 | }); 94 | }, 95 | //关闭弹框 96 | addDialogClosed() { 97 | this.$refs.newForm.resetFields(); 98 | //初始化数据 99 | this.newForm = { 100 | }; 101 | }, 102 | // 监听 pagesize 改变的事件 103 | handleSizeChange(newSize) { 104 | // console.log(newSize) 105 | this.queryinfo.pageSize = newSize; 106 | this.createParams(); 107 | }, 108 | // 监听 页码值 改变的事件 109 | handleCurrentChange(newPage) { 110 | //console.log(newPage) 111 | this.queryinfo.currentPage = newPage; 112 | this.createParams(); 113 | }, 114 | }, 115 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/dbBackLog/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "dbBackLog", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | data: [] 13 | }; 14 | }, 15 | created() { 16 | this.createParams(); 17 | }, 18 | methods: { 19 | //初始化数据 20 | createParams() { 21 | //加载列表 22 | this.$axios 23 | .post("/db/list/page/", this.queryinfo) 24 | .then((res) => { 25 | if (res.data != null && res.data != "") { 26 | this.tableData = res.data.records; 27 | this.total = res.data.total; 28 | } else { 29 | this.$message.error("获取列表失败!"); 30 | } 31 | }) 32 | .catch((err) => { 33 | console.log("报错了" + err); 34 | }); 35 | }, 36 | createDBBack() { 37 | this.$axios 38 | .get("/db/create/") 39 | .then((res) => { 40 | this.$message({ 41 | type: "success", 42 | message: "数据库备份成功!目录为默认 C:/drug..", 43 | }); 44 | this.createParams(); 45 | }) 46 | .catch((err) => { 47 | console.log("报错了" + err); 48 | }); 49 | }, 50 | // 监听 pagesize 改变的事件 51 | handleSizeChange(newSize) { 52 | // console.log(newSize) 53 | this.queryinfo.pageSize = newSize; 54 | this.createParams(); 55 | }, 56 | // 监听 页码值 改变的事件 57 | handleCurrentChange(newPage) { 58 | //console.log(newPage) 59 | this.queryinfo.currentPage = newPage; 60 | this.createParams(); 61 | }, 62 | }, 63 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/drug/typeList.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "drugTypeList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | dialog: { 13 | title: "", 14 | show: false, 15 | }, 16 | newForm: { 17 | }, 18 | rules: { 19 | name: [{ required: true, message: "请输入剂型名", trigger: "blur" }], 20 | }, 21 | data: [], 22 | }; 23 | }, 24 | created() { 25 | this.createParams(); 26 | }, 27 | methods: { 28 | //初始化数据 29 | createParams() { 30 | //加载列表 31 | this.$axios 32 | .post("/drugType/list/page/", this.queryinfo) 33 | .then((res) => { 34 | if (res.data != null && res.data != "") { 35 | this.tableData = res.data.records; 36 | this.total = res.data.total; 37 | } else { 38 | this.$message.error("获取列表失败!"); 39 | } 40 | }) 41 | .catch((err) => { 42 | console.log("报错了" + err); 43 | }); 44 | }, 45 | //展开新建弹框 46 | newObj() { 47 | this.dialog = { 48 | title: "新建剂型", 49 | show: true, 50 | }; 51 | }, 52 | 53 | //展开编辑弹框 54 | edit(id) { 55 | this.dialog = { 56 | title: "编辑剂型", 57 | show: true, 58 | }; 59 | this.$axios 60 | .get("/drugType/loadDetail/" + id + "/") 61 | .then((res) => { 62 | this.newForm = res.data; 63 | }) 64 | .catch((err) => { 65 | console.log("报错了" + err); 66 | }); 67 | }, 68 | //保存弹框 69 | submitForm(formName) { 70 | this.$refs[formName].validate((valid) => { 71 | if (valid) { 72 | this.$axios 73 | .post("/drugType/save/", this.newForm) 74 | .then((res) => { 75 | if (res.data != null && res.data != "") { 76 | this.$message({ 77 | type: "success", 78 | message: "保存成功!", 79 | }); 80 | this.dialog.show = false; 81 | this.createParams(); 82 | } else { 83 | this.$message.error("保存失败!"); 84 | } 85 | }) 86 | .catch((err) => { 87 | console.log("报错了" + err); 88 | }); 89 | } else { 90 | console.log("error submit!"); 91 | return false; 92 | } 93 | }); 94 | }, 95 | //关闭弹框 96 | addDialogClosed() { 97 | this.$refs.newForm.resetFields(); 98 | //初始化数据 99 | this.newForm = { 100 | }; 101 | }, 102 | // 监听 pagesize 改变的事件 103 | handleSizeChange(newSize) { 104 | // console.log(newSize) 105 | this.queryinfo.pageSize = newSize; 106 | this.createParams(); 107 | }, 108 | // 监听 页码值 改变的事件 109 | handleCurrentChange(newPage) { 110 | //console.log(newPage) 111 | this.queryinfo.currentPage = newPage; 112 | this.createParams(); 113 | }, 114 | }, 115 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/goods/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "goodsList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | dialog: { 13 | title: "", 14 | show: false, 15 | }, 16 | newForm: { 17 | }, 18 | rules: { 19 | name: [{ required: true, message: "请输入物资名", trigger: "blur" }], 20 | }, 21 | types: [], 22 | data: [], 23 | }; 24 | }, 25 | created() { 26 | this.createParams(); 27 | }, 28 | methods: { 29 | //初始化数据 30 | createParams() { 31 | //加载列表 32 | this.$axios 33 | .post("/goods/list/page/", this.queryinfo) 34 | .then((res) => { 35 | if (res.data != null && res.data != "") { 36 | this.tableData = res.data.records; 37 | this.total = res.data.total; 38 | } else { 39 | this.$message.error("获取列表失败!"); 40 | } 41 | }) 42 | .catch((err) => { 43 | console.log("报错了" + err); 44 | }); 45 | }, 46 | //展开新建弹框 47 | newRole() { 48 | this.dialog = { 49 | title: "新建物资", 50 | show: true, 51 | }; 52 | }, 53 | 54 | //展开编辑弹框 55 | edit(id) { 56 | this.dialog = { 57 | title: "编辑物资", 58 | show: true, 59 | }; 60 | this.$axios 61 | .get("/goods/loadDetail/" + id + "/") 62 | .then((res) => { 63 | this.newForm = res.data.goods; 64 | }) 65 | .catch((err) => { 66 | console.log("报错了" + err); 67 | }); 68 | }, 69 | //保存 70 | submitForm(formName) { 71 | this.$refs[formName].validate((valid) => { 72 | if (valid) { 73 | this.$axios 74 | .post("/goods/save/", this.newForm) 75 | .then((res) => { 76 | if (res.data != null && res.data != "") { 77 | this.$message({ 78 | type: "success", 79 | message: "保存成功!", 80 | }); 81 | this.dialog.show = false; 82 | this.createParams(); 83 | } else { 84 | this.$message.error("保存失败!"); 85 | } 86 | }) 87 | .catch((err) => { 88 | console.log("报错了" + err); 89 | }); 90 | } else { 91 | console.log("error submit!"); 92 | return false; 93 | } 94 | }); 95 | }, 96 | //关闭弹框 97 | addDialogClosed() { 98 | this.$refs.newForm.resetFields(); 99 | //初始化数据 100 | this.newForm = { 101 | }; 102 | }, 103 | // 监听 pagesize 改变的事件 104 | handleSizeChange(newSize) { 105 | // console.log(newSize) 106 | this.queryinfo.pageSize = newSize; 107 | this.createParams(); 108 | }, 109 | // 监听 页码值 改变的事件 110 | handleCurrentChange(newPage) { 111 | //console.log(newPage) 112 | this.queryinfo.currentPage = newPage; 113 | this.createParams(); 114 | }, 115 | }, 116 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/goodsStorage/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "goodsStorageList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | dialog: { 13 | title: "", 14 | show: false, 15 | }, 16 | newForm: { 17 | }, 18 | // rules: { 19 | // validityBeginTime: [{ required: true, message: "请输入有效期结束时间", trigger: "blur" }], 20 | // }, 21 | data: [], 22 | }; 23 | }, 24 | created() { 25 | this.createParams(); 26 | }, 27 | methods: { 28 | //初始化数据 29 | createParams() { 30 | //加载列表 31 | this.$axios 32 | .post("/goodsStorage/list/page/", this.queryinfo) 33 | .then((res) => { 34 | if (res.data != null && res.data != "") { 35 | this.tableData = res.data.records; 36 | this.total = res.data.total; 37 | } else { 38 | this.$message.error("获取列表失败!"); 39 | } 40 | }) 41 | .catch((err) => { 42 | console.log("报错了" + err); 43 | }); 44 | }, 45 | 46 | // 监听 pagesize 改变的事件 47 | handleSizeChange(newSize) { 48 | // console.log(newSize) 49 | this.queryinfo.pageSize = newSize; 50 | this.createParams(); 51 | }, 52 | // 监听 页码值 改变的事件 53 | handleCurrentChange(newPage) { 54 | //console.log(newPage) 55 | this.queryinfo.currentPage = newPage; 56 | this.createParams(); 57 | }, 58 | }, 59 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/index/index.js: -------------------------------------------------------------------------------- 1 | import headNav from "@/components/headNav"; 2 | import leftSide from "@/components/leftSide"; 3 | export default { 4 | name: "index", 5 | components: { 6 | headNav, 7 | leftSide, 8 | }, 9 | data() { 10 | return { 11 | themeColor: "", 12 | breadList: null, 13 | }; 14 | }, 15 | created() { 16 | this.createParams(); 17 | }, 18 | 19 | methods: { 20 | //初始化主题数据 21 | createParams() { 22 | const id = JSON.parse(localStorage.getItem("auth-user")).id; 23 | this.$axios 24 | .get("/user/get/") 25 | .then((res) => { 26 | if (res.data != null && res.data != "") { 27 | if (res.data.theme == null || res.data.theme == "") { 28 | this.themeColor = "#29374c"; 29 | } else { 30 | this.themeColor = res.data.theme; 31 | } 32 | } 33 | }) 34 | .catch((err) => { 35 | console.log("报错了" + err); 36 | }); 37 | }, 38 | //修改主题颜色 39 | updateColor(updateColor) { 40 | this.$axios 41 | .post("/user/updateTheme/", { 42 | id: JSON.parse(localStorage.getItem("auth-user")).id, 43 | theme: updateColor, 44 | }) 45 | .then((res) => { 46 | if (res.data != null && res.data != "") { 47 | this.$message({ 48 | type: "success", 49 | message: "主题修改成功!", 50 | }); 51 | this.themeColor = updateColor; 52 | this.createParams(); 53 | } 54 | }) 55 | .catch((err) => { 56 | console.log("报错了" + err); 57 | }); 58 | }, 59 | }, 60 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/login/login.js: -------------------------------------------------------------------------------- 1 | 2 | import { mapGetters } from "vuex"; 3 | export default { 4 | name: "login", 5 | data() { 6 | return { 7 | loginUser: { 8 | username: "admin", 9 | password: "123456", 10 | }, 11 | loginRules: { 12 | username: [ 13 | { 14 | required: true, 15 | message: "用户名不能为空", 16 | trigger: "blur", 17 | }, 18 | ], 19 | password: [ 20 | { 21 | required: true, 22 | message: "密码不能为空", 23 | trigger: "blur", 24 | }, 25 | ], 26 | }, 27 | }; 28 | }, 29 | computed: { 30 | ...mapGetters(["bgColor", "themeUser"]), 31 | }, 32 | methods: { 33 | submitForm(formName) { 34 | this.$refs[formName].validate((valid) => { 35 | if (valid) { 36 | var fd = new FormData(); 37 | fd.append("username", this.loginUser.username); 38 | fd.append("password", this.loginUser.password); 39 | this.$axios 40 | .post("/user/login/", fd) 41 | .then((res) => { 42 | if (res.data != null && res.data != "") { 43 | this.$store.dispatch("setIsAutnenticated", true); //token存储到vuex 44 | //请求成功后的处理函数 45 | if(res.data != null && res.data != ""){ 46 | this.logining = false; 47 | //如果返回成功则获取userInfo 48 | this.$axios.post( 49 | '/user/info/' 50 | ) 51 | .then(res => { 52 | const user = res.data; 53 | localStorage.setItem("auth-user", JSON.stringify(user)); 54 | this.$store.dispatch("setUser", user); //user存储到vuex 55 | 56 | this.$router.push({path: '/index'}); 57 | }).catch(err => {//请求失败后的处理函数 58 | console.log(err); 59 | this.logining = false; 60 | }); 61 | } else { 62 | this.$alert('账号或密码错误', '提示', { 63 | confirmButtonText: 'ok' 64 | })} 65 | } 66 | }) 67 | .catch((err) => { 68 | this.$message({ 69 | message: "账号或密码错误", 70 | type: "warning", 71 | }); 72 | }); 73 | } else { 74 | return false; 75 | } 76 | }); 77 | }, 78 | }, 79 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/register/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "registerList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | drugs : [], 13 | types : [], 14 | dialog: { 15 | title: "", 16 | show: false, 17 | }, 18 | newForm: { 19 | }, 20 | rules: { 21 | customerName: [{ required: true, message: "请选择药品", trigger: "blur" }], 22 | customerNo: [{ required: true, message: "请选择操作类型", trigger: "blur" }], 23 | }, 24 | }; 25 | }, 26 | created() { 27 | this.createParams(); 28 | }, 29 | methods: { 30 | //初始化数据 31 | createParams() { 32 | //加载列表 33 | this.$axios 34 | .post("/register/list/page/", this.queryinfo) 35 | .then((res) => { 36 | if (res.data != null && res.data != "") { 37 | this.tableData = res.data.records; 38 | this.total = res.data.total; 39 | } else { 40 | this.$message.error("获取列表失败!"); 41 | } 42 | }) 43 | .catch((err) => { 44 | console.log("报错了" + err); 45 | }); 46 | }, 47 | 48 | //展开新建弹框 49 | newObj() { 50 | this.dialog = { 51 | title: "新建挂号操作", 52 | show: true, 53 | }; 54 | this.$axios 55 | .get("/register/typeList/") 56 | .then((res) => { 57 | this.types = res.data; 58 | }) 59 | .catch((err) => { 60 | console.log("报错了" + err); 61 | }); 62 | }, 63 | 64 | //展开编辑弹框 65 | edit(id) { 66 | this.dialog = { 67 | title: "编辑挂号", 68 | show: true, 69 | }; 70 | this.$axios 71 | .get("/register/loadDetail/" + id + "/") 72 | .then((res) => { 73 | this.newForm = res.data; 74 | }) 75 | .catch((err) => { 76 | console.log("报错了" + err); 77 | }); 78 | }, 79 | 80 | //保存弹框 81 | submitForm(formName) { 82 | this.$refs[formName].validate((valid) => { 83 | if (valid) { 84 | this.$axios 85 | .post("/register/save/", this.newForm) 86 | .then((res) => { 87 | if (res.data != null && res.data != "") { 88 | this.$message({ 89 | type: "success", 90 | message: "保存成功!", 91 | }); 92 | this.dialog.show = false; 93 | this.createParams(); 94 | } else { 95 | this.$message.error("保存失败!"); 96 | } 97 | }) 98 | .catch((err) => { 99 | console.log("报错了" + err); 100 | }); 101 | } else { 102 | console.log("error submit!"); 103 | return false; 104 | } 105 | }); 106 | }, 107 | //关闭弹框 108 | addDialogClosed() { 109 | this.$refs.newForm.resetFields(); 110 | //初始化数据 111 | this.newForm = { 112 | }; 113 | }, 114 | // 监听 pagesize 改变的事件 115 | handleSizeChange(newSize) { 116 | // console.log(newSize) 117 | this.queryinfo.pageSize = newSize; 118 | this.createParams(); 119 | }, 120 | // 监听 页码值 改变的事件 121 | handleCurrentChange(newPage) { 122 | //console.log(newPage) 123 | this.queryinfo.currentPage = newPage; 124 | this.createParams(); 125 | }, 126 | }, 127 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/roomStorage/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "roomStorageList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | dialog: { 13 | title: "", 14 | show: false, 15 | }, 16 | newForm: { 17 | }, 18 | rules: { 19 | validityEndTime: [{ required: true, message: "请输入有效期结束时间", trigger: "blur" }], 20 | }, 21 | data: [], 22 | }; 23 | }, 24 | created() { 25 | this.createParams(); 26 | }, 27 | methods: { 28 | //初始化数据 29 | createParams() { 30 | //加载列表 31 | this.$axios 32 | .post("/roomStorage/list/page/", this.queryinfo) 33 | .then((res) => { 34 | if (res.data != null && res.data != "") { 35 | this.tableData = res.data.records; 36 | this.total = res.data.total; 37 | } else { 38 | this.$message.error("获取列表失败!"); 39 | } 40 | }) 41 | .catch((err) => { 42 | console.log("报错了" + err); 43 | }); 44 | }, 45 | 46 | //展开编辑弹框 47 | edit(id) { 48 | this.dialog = { 49 | title: "编辑有效期结束时间", 50 | show: true, 51 | }; 52 | this.$axios 53 | .get("/roomStorage/loadDetail/" + id + "/") 54 | .then((res) => { 55 | this.newForm = res.data; 56 | }) 57 | .catch((err) => { 58 | console.log("报错了" + err); 59 | }); 60 | }, 61 | //保存弹框 62 | submitForm(formName) { 63 | this.$refs[formName].validate((valid) => { 64 | if (valid) { 65 | this.$axios 66 | .post("/roomStorage/save/", this.newForm) 67 | .then((res) => { 68 | if (res.data != null && res.data != "") { 69 | this.$message({ 70 | type: "success", 71 | message: "保存成功!", 72 | }); 73 | this.dialog.show = false; 74 | this.createParams(); 75 | } else { 76 | this.$message.error("保存失败!"); 77 | } 78 | }) 79 | .catch((err) => { 80 | console.log("报错了" + err); 81 | }); 82 | } else { 83 | console.log("error submit!"); 84 | return false; 85 | } 86 | }); 87 | }, 88 | //关闭弹框 89 | addDialogClosed() { 90 | this.$refs.newForm.resetFields(); 91 | //初始化数据 92 | this.newForm = { 93 | }; 94 | }, 95 | // 监听 pagesize 改变的事件 96 | handleSizeChange(newSize) { 97 | // console.log(newSize) 98 | this.queryinfo.pageSize = newSize; 99 | this.createParams(); 100 | }, 101 | // 监听 页码值 改变的事件 102 | handleCurrentChange(newPage) { 103 | //console.log(newPage) 104 | this.queryinfo.currentPage = newPage; 105 | this.createParams(); 106 | }, 107 | }, 108 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/storage/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "storageList", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | dialog: { 13 | title: "", 14 | show: false, 15 | }, 16 | newForm: { 17 | }, 18 | rules: { 19 | validityEndTime: [{ required: true, message: "请输入有效期结束时间", trigger: "blur" }], 20 | }, 21 | data: [], 22 | }; 23 | }, 24 | created() { 25 | this.createParams(); 26 | }, 27 | methods: { 28 | //初始化数据 29 | createParams() { 30 | //加载列表 31 | this.$axios 32 | .post("/storage/list/page/", this.queryinfo) 33 | .then((res) => { 34 | if (res.data != null && res.data != "") { 35 | this.tableData = res.data.records; 36 | this.total = res.data.total; 37 | } else { 38 | this.$message.error("获取列表失败!"); 39 | } 40 | }) 41 | .catch((err) => { 42 | console.log("报错了" + err); 43 | }); 44 | }, 45 | 46 | //展开编辑弹框 47 | edit(id) { 48 | this.dialog = { 49 | title: "编辑有效期结束时间", 50 | show: true, 51 | }; 52 | this.$axios 53 | .get("/storage/loadDetail/" + id + "/") 54 | .then((res) => { 55 | this.newForm = res.data; 56 | }) 57 | .catch((err) => { 58 | console.log("报错了" + err); 59 | }); 60 | }, 61 | //保存弹框 62 | submitForm(formName) { 63 | this.$refs[formName].validate((valid) => { 64 | if (valid) { 65 | this.$axios 66 | .post("/storage/save/", this.newForm) 67 | .then((res) => { 68 | if (res.data != null && res.data != "") { 69 | this.$message({ 70 | type: "success", 71 | message: "保存成功!", 72 | }); 73 | this.dialog.show = false; 74 | this.createParams(); 75 | } else { 76 | this.$message.error("保存失败!"); 77 | } 78 | }) 79 | .catch((err) => { 80 | console.log("报错了" + err); 81 | }); 82 | } else { 83 | console.log("error submit!"); 84 | return false; 85 | } 86 | }); 87 | }, 88 | //关闭弹框 89 | addDialogClosed() { 90 | this.$refs.newForm.resetFields(); 91 | //初始化数据 92 | this.newForm = { 93 | }; 94 | }, 95 | // 监听 pagesize 改变的事件 96 | handleSizeChange(newSize) { 97 | // console.log(newSize) 98 | this.queryinfo.pageSize = newSize; 99 | this.createParams(); 100 | }, 101 | // 监听 页码值 改变的事件 102 | handleCurrentChange(newPage) { 103 | //console.log(newPage) 104 | this.queryinfo.currentPage = newPage; 105 | this.createParams(); 106 | }, 107 | }, 108 | }; -------------------------------------------------------------------------------- /drug-vue/src/js/userLoginLog/list.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: "userLoginLog", 3 | data() { 4 | return { 5 | queryinfo: { 6 | currentPage: 1, 7 | keyword: "", 8 | pageSize: 10, 9 | }, 10 | tableData: [], 11 | total: 0, 12 | data: [] 13 | }; 14 | }, 15 | created() { 16 | this.createParams(); 17 | }, 18 | methods: { 19 | //初始化数据 20 | createParams() { 21 | //加载列表 22 | this.$axios 23 | .post("/user/loginLog/page/", this.queryinfo) 24 | .then((res) => { 25 | if (res.data != null && res.data != "") { 26 | this.tableData = res.data.records; 27 | this.total = res.data.total; 28 | } else { 29 | this.$message.error("获取列表失败!"); 30 | } 31 | }) 32 | .catch((err) => { 33 | console.log("报错了" + err); 34 | }); 35 | }, 36 | 37 | 38 | // 监听 pagesize 改变的事件 39 | handleSizeChange(newSize) { 40 | // console.log(newSize) 41 | this.queryinfo.pageSize = newSize; 42 | this.createParams(); 43 | }, 44 | // 监听 页码值 改变的事件 45 | handleCurrentChange(newPage) { 46 | //console.log(newPage) 47 | this.queryinfo.currentPage = newPage; 48 | this.createParams(); 49 | }, 50 | }, 51 | }; -------------------------------------------------------------------------------- /drug-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import axios from './http' 6 | import has from './views/permission/permission.js' 7 | import ElementUI from 'element-ui' 8 | import VueParticles from 'vue-particles' 9 | import 'element-ui/lib/theme-chalk/index.css' 10 | import './styles/reset.css' 11 | import VCharts from 'v-charts' 12 | 13 | Vue.use(ElementUI); 14 | Vue.use(VueParticles); 15 | Vue.use(VCharts) 16 | Vue.config.productionTip = false; 17 | Vue.prototype.$axios = axios; 18 | 19 | new Vue({ 20 | router, 21 | store, 22 | render: h => h(App) 23 | }).$mount('#app') 24 | 25 | axios.defaults.withCredentials = true; 26 | -------------------------------------------------------------------------------- /drug-vue/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | Vue.use(Vuex) 4 | 5 | const types = { 6 | SET_IS_AUTNENTIATED: 'SET_IS_AUTNENTIATED', // 是否认证通过 7 | SET_USER: 'SET_USER', // 用户信息 8 | } 9 | 10 | 11 | const state = { 12 | isAutnenticated: false, // 是否认证 13 | user: { 14 | permissions: [], 15 | roles: [], 16 | }, // 存储用户信息 17 | 18 | 19 | }; 20 | const getters = { 21 | isAutnenticated: state => state.isAutnenticated, 22 | user: state => state.user, 23 | }; 24 | const mutations = { 25 | [types.SET_IS_AUTNENTIATED](state, isAutnenticated) { 26 | if (isAutnenticated) 27 | state.isAutnenticated = isAutnenticated 28 | else 29 | state.isAutnenticated = false 30 | }, 31 | [types.SET_USER](state, user) { 32 | if (user) { 33 | state.user = user; 34 | state.user.permissions = user.permissions; 35 | state.user.roles = user.roles; 36 | } else { 37 | state.user = {}; 38 | } 39 | }, 40 | }; 41 | const actions = { 42 | setIsAutnenticated: ({ commit }, isAutnenticated) => { 43 | commit(types.SET_IS_AUTNENTIATED, isAutnenticated) 44 | }, 45 | setUser: ({ commit }, user) => { 46 | commit(types.SET_USER, user) 47 | }, 48 | clearCurrentState: ({ commit }) => { 49 | commit(types.SET_IS_AUTNENTIATED, false) 50 | commit(types.SET_USER, null) 51 | }, 52 | }; 53 | export default new Vuex.Store({ 54 | state, 55 | getters, 56 | mutations, 57 | actions, 58 | }) -------------------------------------------------------------------------------- /drug-vue/src/styles/reset.css: -------------------------------------------------------------------------------- 1 | @charset 'utf-8'; 2 | 3 | * { 4 | margin: 0; 5 | padding: 0; 6 | } 7 | 8 | html, 9 | body, 10 | #app, 11 | .wrapper { 12 | width: 100%; 13 | height: 100%; 14 | overflow: hidden; 15 | } 16 | 17 | body { 18 | font-family:Arial,"Microsoft YaHei",Helvetica, sans-serif; 19 | } 20 | 21 | a { 22 | text-decoration: none 23 | } 24 | 25 | ol, ul { 26 | list-style: none; 27 | } 28 | h1,h2,h3,h4,h5,h6{font-weight: normal;} 29 | em,i{font-style: normal;} 30 | 31 | .el-transfer-panel { width: 37%;} 32 | .el-transfer-panel__body{height: 445px;} 33 | .el-transfer-panel__list.is-filterable{height: 85%;} -------------------------------------------------------------------------------- /drug-vue/src/views/permission/permission.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | /**权限指令**/ 4 | const has = Vue.directive('has', { 5 | inserted: function (el, binding, vnode) { 6 | //console.log(binding) 7 | // 获取页面按钮权限 8 | if (!Vue.prototype.$_has(binding.arg)) { 9 | el.parentNode.removeChild(el); 10 | } 11 | } 12 | }); 13 | 14 | 15 | // 权限检查方法 16 | Vue.prototype.$_has = function (value) { 17 | let allow = false; 18 | // 获取用户按钮权限 19 | let authUser = JSON.parse(localStorage.getItem("auth-user")) 20 | //获取角色 21 | let roles = authUser.roles; 22 | //无角色不允许访问 23 | if (roles.length == 0) { 24 | return false; 25 | } 26 | //包含管理员角色不限制 27 | let isAdmin = authUser.roles.some(function (item, index) { 28 | return item.name === "admin"; 29 | }); 30 | 31 | if (isAdmin) { 32 | return true; 33 | } 34 | 35 | 36 | for (let i = 0; i < roles.length; i++) { 37 | let eachRole = roles[i]; 38 | if(eachRole.permissionNames == null){ 39 | return false; 40 | } else { 41 | allow = eachRole.permissionNames.some(function (item, index) { 42 | return item === value; 43 | }); 44 | 45 | if (allow) { 46 | return true; 47 | } 48 | } 49 | } 50 | return allow; 51 | }; 52 | export { has } -------------------------------------------------------------------------------- /drug-vue/vue.config.js: -------------------------------------------------------------------------------- 1 | // vue.config.js 2 | const path = require('path'); 3 | const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV); 4 | const resolve = (dir) => path.join(__dirname, dir); 5 | module.exports = { 6 | publicPath: process.env.NODE_ENV === 'production' ? '/site/vue-demo/' : '/', // 公共路径 7 | indexPath: 'index.html', // 相对于打包路径index.html的路径 8 | outputDir: process.env.outputDir || 'dist', // 'dist', 生产环境构建文件的目录 9 | assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录 10 | lintOnSave: false, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码 11 | runtimeCompiler: true, // 是否使用包含运行时编译器的 Vue 构建版本 12 | productionSourceMap: !IS_PROD, // 生产环境的 source map 13 | parallel: require("os").cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。 14 | pwa: {}, // 向 PWA 插件传递选项。 15 | chainWebpack: config => { 16 | config.resolve.symlinks(true); // 修复热更新失效 17 | // 如果使用多页面打包,使用vue inspect --plugins查看html是否在结果数组中 18 | config.plugin("html").tap(args => { 19 | // 修复 Lazy loading routes Error 20 | args[0].chunksSortMode = "none"; 21 | return args; 22 | }); 23 | }, 24 | devServer: { 25 | overlay: { // 让浏览器 overlay 同时显示警告和错误 26 | warnings: true, 27 | errors: true 28 | }, 29 | host: "localhost", 30 | port: 8889, // 端口号 31 | https: false, // https:{type:Boolean} 32 | open: false, //配置自动启动浏览器 33 | hotOnly: true, // 热更新 34 | proxy: "http://localhost:8888" 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /drug/.gitignore: -------------------------------------------------------------------------------- 1 | /out/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | *.zip 4 | *.docs 5 | /drug/target/ 6 | /drug-vue/node_modules/ 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 | .mvn 22 | mvnw 23 | mvnw.cmd 24 | 25 | ### NetBeans ### 26 | /nbproject/private/ 27 | /build/ 28 | /nbbuild/ 29 | /dist/ 30 | /nbdist/ 31 | /.nb-gradle/ 32 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/Application.java: -------------------------------------------------------------------------------- 1 | package com.drug; 2 | 3 | import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.boot.builder.SpringApplicationBuilder; 8 | import org.springframework.boot.web.servlet.ServletComponentScan; 9 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 10 | import org.springframework.context.annotation.Configuration; 11 | import org.springframework.transaction.annotation.EnableTransactionManagement; 12 | 13 | @Configuration 14 | @EnableTransactionManagement 15 | @MapperScan("com.drug.dao") 16 | @SpringBootApplication(scanBasePackages = "com.drug") 17 | @ServletComponentScan 18 | @NacosPropertySource(dataId = "example", autoRefreshed = true) 19 | public class Application extends SpringBootServletInitializer { 20 | 21 | /** 22 | * 如果要发布到自己的Tomcat中的时候,需要继承SpringBootServletInitializer类,并且增加如下的configure方法。 23 | * 如果不发布到自己的Tomcat中的时候,就无需上述的步骤 24 | */ 25 | protected SpringApplicationBuilder configure( 26 | SpringApplicationBuilder application) { 27 | return application.sources(Application.class); 28 | } 29 | 30 | public static void main(String[] args) throws Exception { 31 | SpringApplication.run(Application.class, args); 32 | } 33 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/APIResult.java: -------------------------------------------------------------------------------- 1 | package com.drug.api; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | /** 7 | * 接口返回 8 | * 9 | * @param 10 | */ 11 | @ApiModel(description="API返回公共组件") 12 | public class APIResult extends ResultSupport { 13 | 14 | private static final long serialVersionUID = -1444725629728008153L; 15 | 16 | @ApiModelProperty(value="返回数据对象") 17 | protected T data; 18 | 19 | public T getData() { 20 | return data; 21 | } 22 | 23 | public void setData(T data) { 24 | this.data = data; 25 | } 26 | 27 | /** 28 | * 接口调用失败,有错误字符串码和描述,有返回对象 29 | * @param code 30 | * @param message 31 | * @param data 32 | * @param 33 | * @return 34 | */ 35 | public static APIResult newFailResult(int code, String message, U data) { 36 | APIResult apiResult = new APIResult(); 37 | apiResult.setCode(code); 38 | apiResult.setMessage(message); 39 | apiResult.setData(data); 40 | return apiResult; 41 | } 42 | 43 | /** 44 | * 接口调用失败,有错误字符串码和描述,没有返回对象 45 | * @param code 46 | * @param message 47 | * @param 48 | * @return 49 | */ 50 | public static APIResult newFailResult(int code, String message) { 51 | APIResult apiResult = new APIResult(); 52 | apiResult.setCode(code); 53 | apiResult.setMessage(message); 54 | return apiResult; 55 | } 56 | 57 | /** 58 | * 接口调用失败,有默认字符串码和描述,没有返回对象 59 | * @param message 60 | * @param 61 | * @return 62 | */ 63 | public static APIResult newFailResult(String message) { 64 | return newFailResult(ResultCode.ERROR_CODE, message); 65 | } 66 | 67 | /** 68 | * 接口调用失败,有默认字符串码,没有描述,没有返回对象 69 | * @param 70 | * @return 71 | */ 72 | public static APIResult newFailResult() { 73 | return newFailResult(null); 74 | } 75 | 76 | /** 77 | * 接口调用成功返回数据 包含对象属性及CODE 78 | * @param data 79 | * @return 80 | */ 81 | public static APIResult newSuccessResult(int code, U data){ 82 | APIResult apiResult = new APIResult(); 83 | apiResult.setCode(code); 84 | apiResult.setData(data); 85 | return apiResult; 86 | } 87 | 88 | /** 89 | * 接口调用成功返回数据 包含对象属性 90 | * @param data 91 | * @return 92 | */ 93 | public static APIResult newSuccessResult(U data){ 94 | return newSuccessResult(ResultCode.SUCCESS_CODE, data); 95 | } 96 | 97 | /** 98 | * 接口调用成功返回数据 不包含对象属性 99 | * @return 100 | * @return 101 | */ 102 | public static APIResult newSuccessResult(){ 103 | return newSuccessResult(null); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.drug.api; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | @ApiModel(description="返回编码") 7 | public class ResultCode { 8 | @ApiModelProperty(value="成功") 9 | public static final int SUCCESS_CODE = 1; 10 | @ApiModelProperty(value="失败") 11 | public static final int ERROR_CODE = -1; 12 | } 13 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/ResultSupport.java: -------------------------------------------------------------------------------- 1 | package com.drug.api; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.io.Serializable; 6 | 7 | public class ResultSupport implements Serializable { 8 | 9 | private static final long serialVersionUID = -2235152751651905167L; 10 | 11 | @ApiModelProperty(value="返回描述") 12 | private String message; 13 | @ApiModelProperty(value="返回编码") 14 | private int code; 15 | @ApiModelProperty(value="是否成功") 16 | public boolean isSuccess() { 17 | return code == ResultCode.SUCCESS_CODE; 18 | } 19 | 20 | public String getMessage() { 21 | return message; 22 | } 23 | 24 | public void setMessage(String message) { 25 | this.message = message; 26 | } 27 | 28 | public int getCode() { 29 | return code; 30 | } 31 | 32 | public void setCode(int code) { 33 | this.code = code; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/request/BaseRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.api.request; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | import java.io.Serializable; 7 | 8 | @ApiModel(description="公共请求对象") 9 | public class BaseRequest implements Serializable { 10 | 11 | private static final long serialVersionUID = -2377420023435115428L; 12 | 13 | @ApiModelProperty(name="ID", value="实体ID") 14 | protected Integer id; 15 | 16 | public Integer getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Integer id) { 21 | this.id = id; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/request/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.api.request; 2 | 3 | import java.io.Serializable; 4 | 5 | public class BaseResponse implements Serializable{ 6 | 7 | private static final long serialVersionUID = -5157110200926411907L; 8 | 9 | protected Integer id; 10 | 11 | public Integer getId() { 12 | return id; 13 | } 14 | 15 | public void setId(Integer id) { 16 | this.id = id; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/response/CommonPageRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.api.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | 7 | @ApiModel(description="分页公共组件") 8 | public class CommonPageRequest extends BaseRequest { 9 | @ApiModelProperty(value="当前页", example="1", required=true) 10 | protected Integer currentPage; 11 | @ApiModelProperty(value="每页个数", example="10", required=true) 12 | protected Integer pageSize; 13 | @ApiModelProperty(value="关键字", example="", required=false, allowEmptyValue=true) 14 | protected String keyword; 15 | 16 | public Integer getCurrentPage() { 17 | return currentPage; 18 | } 19 | 20 | public Integer getPageSize() { 21 | return pageSize; 22 | } 23 | 24 | public String getKeyword() { 25 | return keyword; 26 | } 27 | 28 | public void setCurrentPage(Integer currentPage) { 29 | this.currentPage = currentPage; 30 | } 31 | 32 | public void setPageSize(Integer pageSize) { 33 | this.pageSize = pageSize; 34 | } 35 | 36 | public void setKeyword(String keyword) { 37 | this.keyword = keyword; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "CommonPageRequest [currentPage=" + currentPage + ", pageSize=" + pageSize + ", keyword=" + keyword 43 | + "]"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/api/response/CommonPageResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.api.response; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | @ApiModel(description="分页公共组件") 7 | public class CommonPageResponse { 8 | @ApiModelProperty(value="当前页", example="1", required=true) 9 | protected Integer currentPage; 10 | @ApiModelProperty(value="每页个数", example="10", required=true) 11 | protected Integer pageSize; 12 | @ApiModelProperty(value="关键字", example="", required=false, allowEmptyValue=true) 13 | protected String keyword; 14 | 15 | public Integer getCurrentPage() { 16 | return currentPage; 17 | } 18 | 19 | public Integer getPageSize() { 20 | return pageSize; 21 | } 22 | 23 | public String getKeyword() { 24 | return keyword; 25 | } 26 | 27 | public void setCurrentPage(Integer currentPage) { 28 | this.currentPage = currentPage; 29 | } 30 | 31 | public void setPageSize(Integer pageSize) { 32 | this.pageSize = pageSize; 33 | } 34 | 35 | public void setKeyword(String keyword) { 36 | this.keyword = keyword; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "CommonPageRequest [currentPage=" + currentPage + ", pageSize=" + pageSize + ", keyword=" + keyword 42 | + "]"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/common/Constant.java: -------------------------------------------------------------------------------- 1 | package com.drug.common; 2 | 3 | public class Constant { 4 | /** 5 | * 报警酷讯数量景点 6 | */ 7 | public static final int WARN_STORAGE_NUM = 50; 8 | 9 | public class UserLevel{ 10 | /** 11 | * 管理员 12 | */ 13 | public static final int MASTER = 1; 14 | } 15 | 16 | public class UserPermission{ 17 | /** 18 | * 用户权限分割标记 19 | */ 20 | public static final String SPLIT_TAG = "###"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/ConfigBeanValue.java: -------------------------------------------------------------------------------- 1 | package com.drug.config; 2 | 3 | import org.springframework.context.annotation.PropertySource; 4 | import org.springframework.context.annotation.PropertySources; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * properties配置文件中数据的读取 9 | * LIKE: 10 | * @Autowired 11 | * private ConfigBeanValue configBeanValue; 12 | */ 13 | @Component 14 | @PropertySources(value = {@PropertySource("classpath:application.properties")}) 15 | public class ConfigBeanValue { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.drug.config; 2 | 3 | import com.baomidou.mybatisplus.annotation.DbType; 4 | import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; 5 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 6 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | /** 11 | * MybatisPlus配置类 12 | */ 13 | @Configuration 14 | public class MybatisPlusConfig { 15 | /** 16 | * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除) 17 | */ 18 | @Bean 19 | public MybatisPlusInterceptor mybatisPlusInterceptor() { 20 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 21 | PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); 22 | paginationInnerInterceptor.setDbType(DbType.MYSQL); 23 | paginationInnerInterceptor.setOverflow(true); 24 | interceptor.addInnerInterceptor(paginationInnerInterceptor); 25 | return interceptor; 26 | } 27 | 28 | @Bean 29 | public ConfigurationCustomizer configurationCustomizer() { 30 | return configuration -> configuration.setUseDeprecatedExecutor(false); 31 | } 32 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/TransactionAdviceConfig.java: -------------------------------------------------------------------------------- 1 | package com.drug.config; 2 | 3 | import org.aspectj.lang.annotation.Aspect; 4 | import org.springframework.aop.Advisor; 5 | import org.springframework.aop.aspectj.AspectJExpressionPointcut; 6 | import org.springframework.aop.support.DefaultPointcutAdvisor; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import org.springframework.transaction.PlatformTransactionManager; 11 | import org.springframework.transaction.TransactionDefinition; 12 | import org.springframework.transaction.interceptor.DefaultTransactionAttribute; 13 | import org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource; 14 | import org.springframework.transaction.interceptor.TransactionInterceptor; 15 | 16 | @Aspect 17 | @Configuration 18 | public class TransactionAdviceConfig { 19 | private static final String AOP_POINTCUT_EXPRESSION = "execution (* com.drug.service..*.*(..))"; 20 | 21 | @Autowired 22 | private PlatformTransactionManager transactionManager; 23 | 24 | @Bean 25 | public TransactionInterceptor txAdvice() { 26 | 27 | DefaultTransactionAttribute txAttr_REQUIRED = new DefaultTransactionAttribute(); 28 | txAttr_REQUIRED.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); 29 | 30 | DefaultTransactionAttribute txAttr_REQUIRED_READONLY = new DefaultTransactionAttribute(); 31 | txAttr_REQUIRED_READONLY.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); 32 | txAttr_REQUIRED_READONLY.setReadOnly(true); 33 | 34 | NameMatchTransactionAttributeSource source = new NameMatchTransactionAttributeSource(); 35 | source.addTransactionalMethod("add*", txAttr_REQUIRED); 36 | source.addTransactionalMethod("save*", txAttr_REQUIRED); 37 | source.addTransactionalMethod("delete*", txAttr_REQUIRED); 38 | source.addTransactionalMethod("update*", txAttr_REQUIRED); 39 | source.addTransactionalMethod("exec*", txAttr_REQUIRED); 40 | source.addTransactionalMethod("set*", txAttr_REQUIRED); 41 | source.addTransactionalMethod("get*", txAttr_REQUIRED_READONLY); 42 | source.addTransactionalMethod("query*", txAttr_REQUIRED_READONLY); 43 | source.addTransactionalMethod("find*", txAttr_REQUIRED_READONLY); 44 | source.addTransactionalMethod("list*", txAttr_REQUIRED_READONLY); 45 | source.addTransactionalMethod("count*", txAttr_REQUIRED_READONLY); 46 | source.addTransactionalMethod("is*", txAttr_REQUIRED_READONLY); 47 | return new TransactionInterceptor(transactionManager, source); 48 | } 49 | 50 | @Bean 51 | public Advisor txAdviceAdvisor() { 52 | AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut(); 53 | pointcut.setExpression(AOP_POINTCUT_EXPRESSION); 54 | return new DefaultPointcutAdvisor(pointcut, txAdvice()); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/filter/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.filter; 2 | 3 | import org.springframework.boot.autoconfigure.AutoConfigureBefore; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 7 | 8 | @Configuration 9 | @AutoConfigureBefore(WebMvcConfigurer.class) 10 | public class CorsConfig implements WebMvcConfigurer { 11 | public void addCorsMappings(CorsRegistry registry){ 12 | registry.addMapping("/**") 13 | .allowedOrigins("http://localhost:8889") 14 | .allowedMethods("*") 15 | .allowedHeaders("*") 16 | .allowCredentials(true) 17 | .maxAge(3600); 18 | } 19 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/filter/MyWebFilter.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.filter; 2 | 3 | import org.springframework.core.annotation.Order; 4 | import org.springframework.web.filter.OncePerRequestFilter; 5 | 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.ServletException; 8 | import javax.servlet.annotation.WebFilter; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import java.io.IOException; 12 | 13 | @Order(1) 14 | @WebFilter(filterName = "myWebFilter", urlPatterns="/*") 15 | public class MyWebFilter extends OncePerRequestFilter { 16 | 17 | @Override 18 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { 19 | if("OPTIONS".equalsIgnoreCase(request.getMethod())){ 20 | response.setStatus(HttpServletResponse.SC_OK); 21 | return; 22 | } 23 | filterChain.doFilter(request, response); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/secure/MyAuthenticationDetailsSource.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.secure; 2 | 3 | import org.springframework.security.authentication.AuthenticationDetailsSource; 4 | import org.springframework.security.web.authentication.WebAuthenticationDetails; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | /** 10 | * 配置自定义的验证参数 11 | */ 12 | @Component 13 | public class MyAuthenticationDetailsSource implements AuthenticationDetailsSource { 14 | 15 | @Override 16 | public WebAuthenticationDetails buildDetails(HttpServletRequest context) { 17 | return new MyWebAuthenticationDetails(context); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/secure/MyUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.secure; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; 5 | import com.drug.entity.user.User; 6 | import com.drug.service.user.UserService; 7 | import org.apache.commons.lang3.StringUtils; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 11 | import org.springframework.stereotype.Component; 12 | 13 | import java.util.List; 14 | 15 | 16 | @Component 17 | public class MyUserDetailsService implements UserDetailsService { 18 | 19 | @Autowired 20 | private UserService userService; 21 | 22 | @Override 23 | public User loadUserByUsername(String username) { 24 | 25 | System.out.println("==============loadUserByUsername=========" + username); 26 | 27 | if (StringUtils.isBlank(username)) { 28 | throw new UsernameNotFoundException("用户名为空"); 29 | } 30 | QueryWrapper wrapper = Wrappers.query(); 31 | wrapper.eq("user_name", username); 32 | List users = userService.list(wrapper); 33 | if (users == null || users.size() == 0) { 34 | throw new UsernameNotFoundException("用户不存在"); 35 | } 36 | return users.get(0); 37 | } 38 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/secure/MyWebAuthenticationDetails.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.secure; 2 | 3 | import org.springframework.security.web.authentication.WebAuthenticationDetails; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | /** 8 | * 接受验证的参数 目前只有账号密码 如果有验证码需要重新加参数 9 | * 10 | */ 11 | public class MyWebAuthenticationDetails extends WebAuthenticationDetails { 12 | 13 | private static final long serialVersionUID = 6975601077710753878L; 14 | 15 | private String username; 16 | 17 | private String password; 18 | 19 | public String getUsername() { 20 | return username; 21 | } 22 | 23 | public void setUsername(String username) { 24 | this.username = username; 25 | } 26 | 27 | public String getPassword() { 28 | return password; 29 | } 30 | 31 | public void setPassword(String password) { 32 | this.password = password; 33 | } 34 | 35 | 36 | public MyWebAuthenticationDetails(HttpServletRequest request) { 37 | super(request); 38 | username = request.getParameter("username"); 39 | password = request.getParameter("password"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/secure/RbacService.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.secure; 2 | 3 | import org.springframework.security.core.Authentication; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | public interface RbacService { 8 | 9 | boolean hasPermission(HttpServletRequest request, Authentication authentication); 10 | } 11 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/config/secure/RbacServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.config.secure; 2 | 3 | import com.drug.common.Constant; 4 | import com.drug.service.user.PermissionService; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.Authentication; 9 | import org.springframework.security.core.GrantedAuthority; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.stereotype.Component; 12 | import org.springframework.util.AntPathMatcher; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import java.util.*; 16 | 17 | /** 18 | * 过滤所有的URL 如果是ADMIN 则通过权限验证,否则根据 USER.ROLES.PERMIMMIOS中拥有权限的URL和当前请求的URL做对接,相等则通过,否则403 19 | */ 20 | @Component("rbacService") 21 | public class RbacServiceImpl implements RbacService { 22 | 23 | @Autowired 24 | protected PermissionService permissionService; 25 | 26 | private AntPathMatcher antPathMatcher = new AntPathMatcher(); 27 | 28 | public static Logger log = LoggerFactory.getLogger(RbacServiceImpl.class); 29 | 30 | @Override 31 | public boolean hasPermission(HttpServletRequest request, Authentication authentication) { 32 | log.debug("=========hasPermission Authentication"); 33 | Object principe = authentication.getPrincipal(); 34 | if(principe instanceof UserDetails) { 35 | //拿到用户名后可以拿到用户角色和用户所有的权限 36 | Collection grantedAuthorities = ((UserDetails) principe).getAuthorities(); 37 | //如果角色是admin 则直接通行 38 | for(GrantedAuthority grantedAuthority : grantedAuthorities){ 39 | if(grantedAuthority.getAuthority().equalsIgnoreCase("ADMIN")){ 40 | log.debug("hasPermission with isAdmin"); 41 | return true; 42 | } 43 | } 44 | 45 | //读取用户所有的url 46 | Set urls = new HashSet(); 47 | for(GrantedAuthority grantedAuthority : grantedAuthorities){ 48 | String roleName = grantedAuthority.getAuthority(); 49 | List permissionUrls = permissionService.getPermissionUrlsByRoleName(roleName); 50 | for(String url : permissionUrls){ 51 | //一个权限 可能包含多个URL 52 | if(url.indexOf(Constant.UserPermission.SPLIT_TAG) != -1){ 53 | 54 | String[] permissions = url.split(Constant.UserPermission.SPLIT_TAG); 55 | List urlStrings = Arrays.asList(permissions); 56 | urls.addAll(urlStrings); 57 | 58 | // urls.addAll(Arrays.asList(url.split(Constant.UserPermission.SPLIT_TAG))); 59 | }else{ 60 | urls.add(url); 61 | } 62 | } 63 | 64 | } 65 | urls.removeAll(java.util.Collections.singleton(null)); 66 | for(Object url : urls) { 67 | if(antPathMatcher.match(url.toString(), request.getRequestURI())) { 68 | log.debug("hasPermission with matchUrl" + request.getRequestURI()); 69 | return true; 70 | } 71 | } 72 | } 73 | log.debug("no Permission " + request.getRequestURI()); 74 | return false; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/customer/CustomerTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.customer; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.customer.CustomerType; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface CustomerTypeMapper extends BaseMapper { 9 | 10 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/db/DBMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.db; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.DBBackLog; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface DBMapper extends BaseMapper { 9 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/drug/DrugMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.drug; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.drug.Drug; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface DrugMapper extends BaseMapper { 13 | 14 | @Select("select r.* from drug r where type_id = #{typeId})") 15 | List getAllByTypeId(@Param("typeId") Integer typeId); 16 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/drug/DrugTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.drug; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.drug.DrugType; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface DrugTypeMapper extends BaseMapper { 9 | 10 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/goods/GoodsMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.goods; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.goods.Goods; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface GoodsMapper extends BaseMapper { 9 | 10 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/goods/GoodsStorageLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.goods; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.goods.GoodsStorageLog; 6 | import com.drug.web.goods.request.GoodsStorageLogSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | @Mapper 12 | public interface GoodsStorageLogMapper extends BaseMapper { 13 | 14 | @Select("") 22 | public IPage getByQueryParams(IPage page, @Param("params") GoodsStorageLogSearchParamRequest params); 23 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/goods/GoodsStorageMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.goods; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.goods.GoodsStorage; 6 | import com.drug.web.goods.request.GoodsStorageSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | import org.apache.ibatis.annotations.Update; 11 | 12 | @Mapper 13 | public interface GoodsStorageMapper extends BaseMapper { 14 | 15 | @Update("update goods_storage set stock_num = ifnull(stock_num,0) + #{num} where goods_id = #{goodsId}") 16 | public Integer updateNumByGoodsId(@Param("goodsId") Integer goodsId, @Param("num") Integer num); 17 | 18 | @Select("select * from goods_storage where goods_id = #{goodsId}") 19 | public GoodsStorage getByGoodsId(@Param("goodsId") Integer goodsId); 20 | 21 | @Select("") 28 | public IPage getByQueryParams(IPage page, @Param("params") GoodsStorageSearchParamRequest params); 29 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/register/RegisterMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.register; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.register.Register; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface RegisterMapper extends BaseMapper { 9 | 10 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/room/RoomSendMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.room; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.room.RoomSend; 6 | import com.drug.web.room.request.RoomSendSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | @Mapper 12 | public interface RoomSendMapper extends BaseMapper { 13 | 14 | @Select("") 24 | public IPage getByQueryParams(IPage page, @Param("params") RoomSendSearchParamRequest params); 25 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/room/RoomStorageLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.room; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.room.RoomStorageLog; 6 | import com.drug.web.room.request.RoomStorageLogSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | @Mapper 12 | public interface RoomStorageLogMapper extends BaseMapper { 13 | 14 | @Select("") 22 | public IPage getByQueryParams(IPage page, @Param("params") RoomStorageLogSearchParamRequest params); 23 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/room/RoomStorageMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.room; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.room.RoomStorage; 6 | import com.drug.web.room.request.RoomStorageSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | import org.apache.ibatis.annotations.Update; 11 | 12 | @Mapper 13 | public interface RoomStorageMapper extends BaseMapper { 14 | 15 | @Update("update room_storage set stock_num = ifnull(stock_num,0) + #{num} where drug_id = #{drugId}") 16 | public Integer updateNumByDrugId(@Param("drugId") Integer drugId, @Param("num") Integer num); 17 | 18 | @Select("select * from room_storage where drug_id = #{drugId}") 19 | public RoomStorage getByDrugId(@Param("drugId") Integer drugId); 20 | 21 | @Select("") 28 | public IPage getByQueryParams(IPage page, @Param("params") RoomStorageSearchParamRequest params); 29 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/storage/StorageLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.storage; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.storage.DrugStorageLog; 6 | import com.drug.web.storage.request.StorageLogSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | @Mapper 12 | public interface StorageLogMapper extends BaseMapper { 13 | 14 | @Select("") 22 | public IPage getByQueryParams(IPage page, @Param("params") StorageLogSearchParamRequest params); 23 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/storage/StorageMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.storage; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.drug.entity.storage.DrugStorage; 6 | import com.drug.web.storage.request.StorageSearchParamRequest; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | import org.apache.ibatis.annotations.Update; 11 | 12 | @Mapper 13 | public interface StorageMapper extends BaseMapper { 14 | 15 | @Update("update drug_storage set stock_num = ifnull(stock_num,0) + #{num} where drug_id = #{drugId}") 16 | public Integer updateNumByDrugId(@Param("drugId") Integer drugId, @Param("num") Integer num); 17 | 18 | @Select("select * from drug_storage where drug_id = #{drugId}") 19 | public DrugStorage getByDrugId(@Param("drugId") Integer drugId); 20 | 21 | @Select("") 28 | public IPage getByQueryParams(IPage page, @Param("params") StorageSearchParamRequest params); 29 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/user/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.user.Permission; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface PermissionMapper extends BaseMapper { 14 | 15 | @Select("select p.name from permission p left join role_permission rp on p.id = rp.permission_id " + 16 | "where rp.role_id = #{roleId}") 17 | public List getPermissionsByRoleId(@Param("roleId") Integer roleId); 18 | 19 | @Select("SELECT p.url FROM Permission p LEFT JOIN role_permission rp ON p.id=rp.PERMISSION_ID " + 20 | "LEFT JOIN role r ON rp.role_id=r.id WHERE r.NAME= #{roleName} AND p.url IS NOT NULL") 21 | public List getPermissionUrlsByRoleName(@Param("roleName") String roleName); 22 | 23 | @Select("select p.* from Permission p where p.parent_id = #{parentId}") 24 | public List loadPermission(@Param("parentId")Integer permissionId); 25 | 26 | @Select("select p.* from Permission p where p.parent_id is null") 27 | public List loadNoParentPermission(); 28 | 29 | @Select(value = "select p.PERMISSION_ID from ROLE_PERMISSION p where p.ROLE_ID = #{roleId}") 30 | public List findPermissionByRoleId(@Param("roleId")Integer roleId); 31 | 32 | @Delete(value = "delete from ROLE_PERMISSION r where r.ROLE_ID =:roleId") 33 | public Integer deletePermissionByRoleId(@Param("roleId")Integer roleId); 34 | 35 | @Select("select p.* from Permission p left join p.roles r where AND p.parent_id is null AND r.id = #{roleId}") 36 | public List loadItemPermission(@Param("roleId")Integer roleId); 37 | 38 | @Select("select p.* from Permission p order by id desc") 39 | public List findAll(); 40 | 41 | @Select("select * FROM Permission WHERE parent_id is null") 42 | public List findItemRoot(); 43 | 44 | @Select("SELECT T2.* FROM ( SELECT @r AS _id, ( SELECT @r := parent_id FROM permission WHERE id = _id ) AS parent_id, " + 45 | "@l := @l + 1 AS lvl FROM (SELECT @r := #{id}, @l := 0) vars, permission m WHERE @r <> 0 ) T1 " + 46 | "JOIN permission T2 ON T1._id = T2.id ORDER BY T1.lvl DESC;") 47 | public List getAllParentsAndSelfById(@Param("id") Integer id); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/user/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.user.Role; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface RoleMapper extends BaseMapper { 13 | 14 | @Select("select r.* from role r where id in (select role_id from user_role where user_id = #{userId})") 15 | List getRolesByUserId(@Param("userId") Integer userId); 16 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/user/RolePermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.user.RolePermission; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | @Mapper 10 | public interface RolePermissionMapper extends BaseMapper { 11 | 12 | @Delete("delete from role_permission where role_id = #{roleId}") 13 | public Integer deleteByRoleId(@Param("roleId") Integer roleId); 14 | 15 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/user/UserLoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.user.UserLoginLog; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface UserLoginLogMapper extends BaseMapper { 9 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/user/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.user.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface UserMapper extends BaseMapper { 9 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/dao/user/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.drug.dao.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.drug.entity.user.UserRole; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | 9 | @Mapper 10 | public interface UserRoleMapper extends BaseMapper { 11 | 12 | @Select("delete from user_role where user_id = #{userId}") 13 | public Integer deleteByUserId(@Param("userId") Integer userId); 14 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/DBBackLog.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.*; 5 | 6 | import java.util.Date; 7 | 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | @TableName("db_back_log") 11 | @Data 12 | public class DBBackLog extends IdEntity { 13 | 14 | protected String userName; 15 | protected Date backTime; 16 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/IdEntity.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | import java.io.Serializable; 9 | 10 | @Setter 11 | @Getter 12 | public abstract class IdEntity implements Serializable, Cloneable { 13 | 14 | private static final long serialVersionUID = -6644147333627738109L; 15 | @TableId(value = "id", type = IdType.AUTO) 16 | protected Integer id; 17 | 18 | /* (non-Javadoc) 19 | * @see java.lang.Object#equals(java.lang.Object) 20 | */ 21 | @Override 22 | public boolean equals(Object obj) { 23 | if (this == obj) { 24 | return true; 25 | } 26 | if (obj == null) { 27 | return false; 28 | } 29 | if (!(obj instanceof IdEntity)) { 30 | return false; 31 | } 32 | IdEntity other = (IdEntity) obj; 33 | if (getId() == null) { 34 | if (other.getId() != null) { 35 | return false; 36 | } else { 37 | return super.equals(obj); 38 | } 39 | } else if (!getId().equals(other.getId())) { 40 | return false; 41 | } 42 | return true; 43 | } 44 | 45 | @Override 46 | public Object clone() throws CloneNotSupportedException { 47 | IdEntity clone = (IdEntity) super.clone(); 48 | clone.setId(null); 49 | return clone; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/customer/CustomerType.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.customer; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.drug.entity.IdEntity; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @NoArgsConstructor 10 | @AllArgsConstructor 11 | @TableName("customer_type") 12 | @Data 13 | public class CustomerType extends IdEntity { 14 | protected String name; 15 | public CustomerType(Integer id) { 16 | this.id = id; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/drug/Drug.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.drug; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.util.Date; 11 | 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @TableName("DRUG") 15 | @Data 16 | public class Drug extends IdEntity { 17 | 18 | protected String name; 19 | protected Date buyDate; 20 | protected Integer typeId; 21 | protected Integer prescriptionType; //处方药类型 22 | protected String company; 23 | protected String specifications; 24 | protected Integer userId; 25 | protected Date createTime; 26 | protected Double price; 27 | @TableField(exist = false) 28 | protected String typeName; 29 | 30 | public Drug(Integer id) { 31 | this.id = id; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/drug/DrugType.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.drug; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.drug.entity.IdEntity; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.NoArgsConstructor; 9 | 10 | @EqualsAndHashCode(callSuper = true) 11 | @NoArgsConstructor 12 | @AllArgsConstructor 13 | @TableName("DRUG_TYPE") 14 | @Data 15 | public class DrugType extends IdEntity { 16 | 17 | protected String name; 18 | 19 | public DrugType(Integer id) { 20 | this.id = id; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/enums/BaseEnum.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.enums; 2 | 3 | import java.io.Serializable; 4 | 5 | public interface BaseEnum extends Serializable{ 6 | /** 7 | * 调用枚举的this.name() 8 | * 如果子类定义name变量,则调用super.name(); 9 | * @return 10 | */ 11 | String getCode(); 12 | 13 | static & BaseEnum> E valueOf(String enumCode,Class clazz) { 14 | E enumm = Enum.valueOf(clazz, enumCode); 15 | return enumm; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/goods/Goods.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.goods; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.drug.entity.IdEntity; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.util.Date; 11 | 12 | @EqualsAndHashCode(callSuper = true) 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | @TableName("GOODS") 16 | @Data 17 | public class Goods extends IdEntity { 18 | 19 | protected String name; 20 | protected Integer userId; 21 | protected Date createTime; 22 | 23 | public Goods(Integer id) { 24 | this.id = id; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/goods/GoodsOperatorTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.goods; 2 | 3 | import com.drug.entity.enums.BaseEnum; 4 | 5 | public enum GoodsOperatorTypeEnum implements BaseEnum { 6 | 7 | // 入库/退库/报升/报损/退回/科室领用 8 | IN (1, "入库", true), 9 | RETURN (2, "退库", true), 10 | UP (3, "报升", true), 11 | DAMAGE (4, "报损", false), 12 | BACK (5, "退回", true), 13 | DEPARTMENT (6, "科室领用", false); 14 | 15 | protected Integer id; 16 | protected String name; 17 | protected Boolean isAdd; // 是否增加数量 18 | 19 | private GoodsOperatorTypeEnum(){ 20 | 21 | } 22 | 23 | private GoodsOperatorTypeEnum(Integer id, String name, Boolean isAdd){ 24 | this.id = id; 25 | this.name = name; 26 | this.isAdd = isAdd; 27 | }; 28 | 29 | public void setId(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | public void setAdd(Boolean add) { 34 | isAdd = add; 35 | } 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | 41 | public Boolean getAdd() { 42 | return isAdd; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public Integer getId() { 50 | return id; 51 | } 52 | 53 | @Override 54 | public String getCode() { 55 | return this.getCode(); 56 | } 57 | 58 | public static GoodsOperatorTypeEnum findById(Integer id) { 59 | if(id == null) { 60 | return null; 61 | } 62 | for (GoodsOperatorTypeEnum enumObj : GoodsOperatorTypeEnum.values()) { 63 | if(enumObj.getId().equals(id) ) 64 | return enumObj; 65 | } 66 | return null; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/goods/GoodsStorage.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.goods; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.NoArgsConstructor; 11 | 12 | @EqualsAndHashCode(callSuper = true) 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | @TableName("goods_storage") 16 | @Data 17 | public class GoodsStorage extends IdEntity { 18 | 19 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" , timezone = "GMT+8") 20 | protected Integer goodsId; 21 | protected Integer stockNum; 22 | 23 | @TableField(exist = false) 24 | protected String goodsName; 25 | 26 | public GoodsStorage(Integer id) { 27 | this.id = id; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/goods/GoodsStorageLog.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.goods; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.util.Date; 12 | 13 | @EqualsAndHashCode(callSuper = true) 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @TableName("goods_storage_log") 17 | @Data 18 | public class GoodsStorageLog extends IdEntity { 19 | 20 | protected Date createTime; 21 | protected Integer goodsId; // 药品ID 22 | protected Integer userId; // userId 23 | protected Integer num; // 数量 24 | protected Integer operatorType;//操作类型 25 | protected Integer operatorEndNum;//本次操作剩余 26 | 27 | @TableField(exist = false) 28 | protected String userName; 29 | @TableField(exist = false) 30 | protected String typeName; 31 | @TableField(exist = false) 32 | protected String goodsName; 33 | 34 | public GoodsStorageLog(Integer id) { 35 | this.id = id; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/register/Register.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.register; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.util.Date; 12 | 13 | @EqualsAndHashCode(callSuper = true) 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @TableName("REGISTER") 17 | @Data 18 | public class Register extends IdEntity { 19 | 20 | protected String customerName; 21 | protected String customerNo; 22 | protected Integer customerType; 23 | protected Date createTime; 24 | protected Integer userId; 25 | 26 | @TableField(exist = false) 27 | protected String userName; 28 | @TableField(exist = false) 29 | protected String customerTypeName; 30 | 31 | public Register(Integer id) { 32 | this.id = id; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/room/RoomOperatorTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.room; 2 | 3 | import com.drug.entity.enums.BaseEnum; 4 | 5 | public enum RoomOperatorTypeEnum implements BaseEnum { 6 | 7 | // 入库/退库/报升/报损/退回/科室领用 8 | IN (1, "入库", true), 9 | RETURN (2, "退库", true), 10 | UP (3, "报升", true), 11 | DAMAGE (4, "报损", false), 12 | BACK (5, "退回", true), 13 | DEPARTMENT (6, "科室领用", false); 14 | 15 | protected Integer id; 16 | protected String name; 17 | protected Boolean isAdd; // 是否增加数量 18 | 19 | private RoomOperatorTypeEnum(){ 20 | 21 | } 22 | 23 | private RoomOperatorTypeEnum(Integer id, String name, Boolean isAdd){ 24 | this.id = id; 25 | this.name = name; 26 | this.isAdd = isAdd; 27 | }; 28 | 29 | public void setId(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | public void setAdd(Boolean add) { 34 | isAdd = add; 35 | } 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | 41 | public Boolean getAdd() { 42 | return isAdd; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public Integer getId() { 50 | return id; 51 | } 52 | 53 | @Override 54 | public String getCode() { 55 | return this.getCode(); 56 | } 57 | 58 | public static RoomOperatorTypeEnum findById(Integer id) { 59 | if(id == null) { 60 | return null; 61 | } 62 | for (RoomOperatorTypeEnum enumObj : RoomOperatorTypeEnum.values()) { 63 | if(enumObj.getId().equals(id) ) 64 | return enumObj; 65 | } 66 | return null; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/room/RoomSend.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.room; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.util.Date; 12 | 13 | @EqualsAndHashCode(callSuper = true) 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @TableName("room_send") 17 | @Data 18 | public class RoomSend extends IdEntity { 19 | 20 | protected Integer drugId; 21 | protected Integer registerId; // 挂号ID 22 | protected Date createTime; 23 | protected Integer userId; // userId 24 | protected Integer num; // 数量 25 | protected Integer operatorEndNum;//本次操作剩余 26 | 27 | @TableField(exist = false) 28 | protected String userName; 29 | @TableField(exist = false) 30 | protected String customerName; 31 | @TableField(exist = false) 32 | protected String customerNo; 33 | @TableField(exist = false) 34 | protected String drugName; 35 | 36 | public RoomSend(Integer id) { 37 | this.id = id; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/room/RoomStorage.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.room; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.NoArgsConstructor; 11 | 12 | import java.util.Date; 13 | 14 | @EqualsAndHashCode(callSuper = true) 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @TableName("room_storage") 18 | @Data 19 | public class RoomStorage extends IdEntity { 20 | 21 | protected Integer drugId; 22 | protected Integer stockNum; 23 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" , timezone = "GMT+8") 24 | protected Date validityEndTime; 25 | 26 | @TableField(exist = false) 27 | protected String drugName; 28 | 29 | public RoomStorage(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/room/RoomStorageLog.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.room; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.util.Date; 12 | 13 | @EqualsAndHashCode(callSuper = true) 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @TableName("room_storage_log") 17 | @Data 18 | public class RoomStorageLog extends IdEntity { 19 | 20 | protected Date createTime; 21 | protected Integer drugId; // 药品ID 22 | protected Integer userId; // userId 23 | protected Integer num; // 数量 24 | protected Integer operatorType;//操作类型 25 | protected Integer operatorEndNum;//本次操作剩余 26 | 27 | @TableField(exist = false) 28 | protected String userName; 29 | @TableField(exist = false) 30 | protected String typeName; 31 | @TableField(exist = false) 32 | protected String drugName; 33 | 34 | public RoomStorageLog(Integer id) { 35 | this.id = id; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/storage/DrugStorage.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.storage; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | import lombok.NoArgsConstructor; 11 | 12 | import java.util.Date; 13 | 14 | @EqualsAndHashCode(callSuper = true) 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @TableName("drug_storage") 18 | @Data 19 | public class DrugStorage extends IdEntity { 20 | 21 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" , timezone = "GMT+8") 22 | protected Date validityEndTime; 23 | protected Integer drugId; 24 | protected Integer stockNum; 25 | 26 | @TableField(exist = false) 27 | protected String drugName; 28 | 29 | public DrugStorage(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/storage/DrugStorageLog.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.storage; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.util.Date; 11 | 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @TableName("drug_storage_log") 15 | @Data 16 | public class DrugStorageLog extends IdEntity { 17 | 18 | protected Date createTime; 19 | // protected Date validityEndTime; 20 | protected Integer drugId; // 药品ID 21 | protected Integer userId; // userId 22 | protected Integer num; // 数量 23 | protected Integer operatorType;//操作类型 24 | protected Integer operatorEndNum;//本次操作剩余 25 | 26 | @TableField(exist = false) 27 | protected String userName; 28 | @TableField(exist = false) 29 | protected String typeName; 30 | @TableField(exist = false) 31 | protected String drugName; 32 | 33 | public DrugStorageLog(Integer id) { 34 | this.id = id; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/storage/StorageOperatorTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.storage; 2 | 3 | import com.drug.entity.enums.BaseEnum; 4 | 5 | public enum StorageOperatorTypeEnum implements BaseEnum { 6 | 7 | // 入库/退库/报升/报损/退回/科室领用 8 | IN (1, "入库", true), 9 | RETURN (2, "退库", true), 10 | UP (3, "报升", true), 11 | DAMAGE (4, "报损", false), 12 | BACK (5, "退回", true), 13 | DEPARTMENT (6, "科室领用", false), 14 | DRUG_RETURN (7, "药房退回", false); 15 | 16 | protected Integer id; 17 | protected String name; 18 | protected Boolean isAdd; // 是否增加数量 19 | 20 | private StorageOperatorTypeEnum(){ 21 | 22 | } 23 | 24 | private StorageOperatorTypeEnum(Integer id, String name, Boolean isAdd){ 25 | this.id = id; 26 | this.name = name; 27 | this.isAdd = isAdd; 28 | }; 29 | 30 | public void setId(Integer id) { 31 | this.id = id; 32 | } 33 | 34 | public void setAdd(Boolean add) { 35 | isAdd = add; 36 | } 37 | 38 | public void setName(String name) { 39 | this.name = name; 40 | } 41 | 42 | public Boolean getAdd() { 43 | return isAdd; 44 | } 45 | 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | public Integer getId() { 51 | return id; 52 | } 53 | 54 | @Override 55 | public String getCode() { 56 | return this.getCode(); 57 | } 58 | 59 | public static StorageOperatorTypeEnum findById(Integer id) { 60 | if(id == null) { 61 | return null; 62 | } 63 | for (StorageOperatorTypeEnum enumObj : StorageOperatorTypeEnum.values()) { 64 | if(enumObj.getId().equals(id) ) 65 | return enumObj; 66 | } 67 | return null; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/user/Permission.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.*; 9 | 10 | @EqualsAndHashCode(callSuper = true) 11 | @ApiModel(value="权限对象") 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @TableName("PERMISSION") 15 | @Data 16 | public class Permission extends IdEntity { 17 | 18 | @ApiModelProperty(value="权限名称") 19 | protected String name; 20 | @ApiModelProperty(value="权限描述") 21 | protected String description; 22 | @ApiModelProperty(value="所属父") 23 | protected Integer parentId; 24 | @ApiModelProperty(value="权限的Api地址") 25 | protected String url; 26 | @TableField(exist = false) 27 | protected String parentName; 28 | 29 | public Permission(Integer id) { 30 | super(); 31 | this.id = id; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/user/Role.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.util.List; 11 | 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @TableName("ROLE") 15 | @Data 16 | public class Role extends IdEntity { 17 | 18 | private static final long serialVersionUID = -6998691082059319752L; 19 | 20 | @TableField("NAME") 21 | protected String name; 22 | @TableField("description") 23 | protected String description; 24 | 25 | @TableField(exist = false) // 权限集合 26 | protected List permissionNames; 27 | 28 | public Role (Integer id) { 29 | this.id = id; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/user/RolePermission.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import lombok.*; 8 | 9 | @ApiModel(value="角色权限对象") 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | @TableName("ROLE_PERMISSION") 13 | @Data 14 | public class RolePermission extends IdEntity { 15 | 16 | @TableField("ROLE_ID") 17 | protected Integer roleId; 18 | 19 | @TableField("PERMISSION_ID") 20 | protected Integer permissionId; 21 | } 22 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/user/User.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.*; 9 | import org.springframework.security.core.GrantedAuthority; 10 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 11 | import org.springframework.security.core.userdetails.UserDetails; 12 | 13 | import java.util.Collection; 14 | import java.util.Date; 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | 18 | @ApiModel(value="用户对象") 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | @TableName("USER") 22 | @Data 23 | public class User extends IdEntity implements UserDetails { 24 | 25 | private static final long serialVersionUID = -6998691082059319752L; 26 | 27 | @ApiModelProperty(value="用户名") 28 | @TableField("USER_NAME") 29 | protected String userName; 30 | @ApiModelProperty(value="员工英文名") 31 | @TableField("EMP_NAME") 32 | protected String empName; 33 | @ApiModelProperty(value="密码") 34 | @TableField("PASSWORD") 35 | protected String password; 36 | @TableField("THEME") 37 | protected String theme; 38 | @ApiModelProperty(value="创建时间", example="2019-01-01 11:11:11") 39 | @TableField("CREATE_TIME") 40 | protected Date createDate; 41 | @ApiModelProperty(value="是否停用") 42 | @TableField("IS_ENABLE") 43 | protected Boolean isEnable; 44 | @ApiModelProperty(value="对应角色") 45 | @TableField(exist = false) 46 | protected Set roles = new HashSet(); 47 | 48 | public User(Integer id) { 49 | super(); 50 | this.id = id; 51 | } 52 | 53 | public User(String userName, String empName, String password, Date createDate, Date lastLoginDate) { 54 | super(); 55 | this.userName = userName; 56 | this.empName = empName; 57 | this.password = password; 58 | this.createDate = createDate; 59 | } 60 | 61 | @Override 62 | public Collection getAuthorities() { 63 | // TODO Auto-generated method stub 64 | Set authorities = new HashSet<>(); 65 | this.getRoles().forEach(r -> authorities.add(new SimpleGrantedAuthority(r.getName()))); 66 | return authorities; 67 | } 68 | 69 | @Override 70 | public String getUsername() { 71 | // TODO Auto-generated method stub 72 | return this.userName; 73 | } 74 | 75 | @Override 76 | public boolean isAccountNonExpired() { 77 | // TODO Auto-generated method stub 78 | return true; 79 | } 80 | 81 | @Override 82 | public boolean isAccountNonLocked() { 83 | // TODO Auto-generated method stub 84 | return true; 85 | } 86 | 87 | @Override 88 | public boolean isCredentialsNonExpired() { 89 | // TODO Auto-generated method stub 90 | return true; 91 | } 92 | 93 | @Override 94 | public boolean isEnabled() { 95 | // TODO Auto-generated method stub 96 | return this.isEnable == null ? false : this.isEnable; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/user/UserLoginLog.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.drug.entity.IdEntity; 5 | import lombok.*; 6 | 7 | import java.util.Date; 8 | 9 | @NoArgsConstructor 10 | @AllArgsConstructor 11 | @TableName("user_login_log") 12 | @Data 13 | public class UserLoginLog extends IdEntity { 14 | 15 | protected String userName; 16 | protected Date loginTime; 17 | protected String des; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/entity/user/UserRole.java: -------------------------------------------------------------------------------- 1 | package com.drug.entity.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.drug.entity.IdEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.*; 9 | 10 | @ApiModel(value="用户角色对象") 11 | @NoArgsConstructor 12 | @AllArgsConstructor 13 | @TableName("USER_ROLE") 14 | @Data 15 | public class UserRole extends IdEntity { 16 | 17 | private static final long serialVersionUID = -6998691082059319752L; 18 | 19 | @ApiModelProperty(value="用户id") 20 | @TableField("USER_ID") 21 | protected Integer userId; 22 | 23 | @ApiModelProperty(value="角色id") 24 | @TableField("ROLE_ID") 25 | protected Integer roleId; 26 | } 27 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/customer/CustomerTypeService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.customer; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.customer.CustomerType; 5 | 6 | public interface CustomerTypeService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/customer/impl/CustomerTypeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.customer.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.customer.CustomerTypeMapper; 5 | import com.drug.entity.customer.CustomerType; 6 | import com.drug.service.customer.CustomerTypeService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class CustomerTypeServiceImpl extends ServiceImpl implements CustomerTypeService { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/db/DBService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.db; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.DBBackLog; 5 | 6 | public interface DBService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/db/impl/DBServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.db.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.db.DBMapper; 5 | import com.drug.entity.DBBackLog; 6 | import com.drug.service.db.DBService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class DBServiceImpl extends ServiceImpl implements DBService { 11 | } 12 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/drug/DrugService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.drug; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.drug.Drug; 5 | 6 | import java.util.List; 7 | 8 | public interface DrugService extends IService { 9 | public List getAllByTypeId(Integer typeId); 10 | } 11 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/drug/DrugTypeService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.drug; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.drug.DrugType; 5 | 6 | public interface DrugTypeService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/drug/impl/DrugServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.drug.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.drug.DrugMapper; 5 | import com.drug.entity.drug.Drug; 6 | import com.drug.service.drug.DrugService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | public class DrugServiceImpl extends ServiceImpl implements DrugService { 14 | 15 | @Autowired 16 | private DrugMapper DrugDao; 17 | 18 | public List getAllByTypeId(Integer typeId) { 19 | return DrugDao.getAllByTypeId(typeId); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/drug/impl/DrugTypeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.drug.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.drug.DrugTypeMapper; 5 | import com.drug.entity.drug.DrugType; 6 | import com.drug.service.drug.DrugTypeService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class DrugTypeServiceImpl extends ServiceImpl implements DrugTypeService { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/goods/GoodsService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.goods; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.goods.Goods; 5 | 6 | public interface GoodsService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/goods/GoodsStorageLogService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.goods; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.goods.GoodsStorageLog; 7 | import com.drug.web.goods.request.GoodsStorageLogSearchParamRequest; 8 | 9 | public interface GoodsStorageLogService extends IService { 10 | public void saveAndUpdateStorage(GoodsStorageLog goodsStorageLog); 11 | 12 | // 查询多参数 13 | public IPage getByQueryParams(Page page, GoodsStorageLogSearchParamRequest params); 14 | } 15 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/goods/GoodsStorageService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.goods; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.goods.GoodsStorage; 7 | import com.drug.web.goods.request.GoodsStorageSearchParamRequest; 8 | 9 | public interface GoodsStorageService extends IService { 10 | // 更新库存 11 | public int updateNumByGoodsId(Integer goodsId, Integer num); 12 | 13 | // 参数查询 14 | public IPage getByQueryParams(Page page, GoodsStorageSearchParamRequest params); 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/goods/impl/GoodsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.goods.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.goods.GoodsMapper; 5 | import com.drug.entity.goods.Goods; 6 | import com.drug.service.goods.GoodsService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class GoodsServiceImpl extends ServiceImpl implements GoodsService { 12 | 13 | @Autowired 14 | private GoodsMapper goodsDao; 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/goods/impl/GoodsStorageLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.goods.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.goods.GoodsStorageLogMapper; 7 | import com.drug.dao.goods.GoodsStorageMapper; 8 | import com.drug.entity.goods.GoodsStorage; 9 | import com.drug.entity.goods.GoodsStorageLog; 10 | import com.drug.entity.storage.StorageOperatorTypeEnum; 11 | import com.drug.service.goods.GoodsStorageLogService; 12 | import com.drug.web.goods.request.GoodsStorageLogSearchParamRequest; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Service; 15 | 16 | @Service 17 | public class GoodsStorageLogServiceImpl extends ServiceImpl implements GoodsStorageLogService { 18 | 19 | @Autowired 20 | private GoodsStorageMapper storageMapper; 21 | 22 | @Autowired 23 | private GoodsStorageLogMapper storageLogMapper; 24 | 25 | @Override 26 | public synchronized void saveAndUpdateStorage(GoodsStorageLog goodsStorageLog) { 27 | GoodsStorage goodsStorage = storageMapper.getByGoodsId(goodsStorageLog.getGoodsId()); 28 | if(goodsStorage == null) { 29 | goodsStorage = new GoodsStorage(); 30 | goodsStorage.setStockNum(goodsStorageLog.getNum()); 31 | goodsStorage.setGoodsId(goodsStorageLog.getGoodsId()); 32 | storageMapper.insert(goodsStorage); 33 | } else { 34 | // 根据类型设置 数量 + - 符号 35 | if(goodsStorageLog.getOperatorType() == StorageOperatorTypeEnum.DAMAGE.getId() 36 | || goodsStorageLog.getOperatorType() == StorageOperatorTypeEnum.DEPARTMENT.getId()) { 37 | goodsStorageLog.setNum(goodsStorageLog.getNum() * -1); 38 | } 39 | storageMapper.updateNumByGoodsId(goodsStorageLog.getGoodsId(), goodsStorageLog.getNum()); 40 | } 41 | goodsStorageLog.setOperatorEndNum(storageMapper.getByGoodsId(goodsStorageLog.getGoodsId()).getStockNum()); 42 | storageLogMapper.insert(goodsStorageLog); 43 | } 44 | 45 | @Override 46 | public IPage getByQueryParams(Page page, GoodsStorageLogSearchParamRequest params) { 47 | return storageLogMapper.getByQueryParams(page, params); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/goods/impl/GoodsStorageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.goods.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.goods.GoodsStorageMapper; 7 | import com.drug.entity.goods.GoodsStorage; 8 | import com.drug.service.goods.GoodsStorageService; 9 | import com.drug.web.goods.request.GoodsStorageSearchParamRequest; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | @Service 14 | public class GoodsStorageServiceImpl extends ServiceImpl implements GoodsStorageService { 15 | 16 | @Autowired 17 | private GoodsStorageMapper goodsStorageMapper; 18 | 19 | @Override 20 | public synchronized int updateNumByGoodsId(Integer goodsId, Integer num) { 21 | return goodsStorageMapper.updateNumByGoodsId(goodsId, num); 22 | } 23 | 24 | @Override 25 | public IPage getByQueryParams(Page page, GoodsStorageSearchParamRequest params) { 26 | return goodsStorageMapper.getByQueryParams(page, params); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/register/RegisterService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.register; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.register.Register; 5 | 6 | public interface RegisterService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/register/impl/RegisterServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.register.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.register.RegisterMapper; 5 | import com.drug.entity.register.Register; 6 | import com.drug.service.register.RegisterService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class RegisterServiceImpl extends ServiceImpl implements RegisterService { 12 | 13 | @Autowired 14 | private RegisterMapper registerDao; 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/room/RoomSendService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.room; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.room.RoomSend; 7 | import com.drug.web.room.request.RoomSendRequest; 8 | import com.drug.web.room.request.RoomSendSearchParamRequest; 9 | 10 | public interface RoomSendService extends IService { 11 | 12 | public void saveAndUpdateStorage(RoomSendRequest roomSendRequest); 13 | 14 | // 查询多参数 15 | public IPage getByQueryParams(Page page, RoomSendSearchParamRequest params); 16 | } 17 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/room/RoomStorageLogService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.room; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.room.RoomStorageLog; 7 | import com.drug.web.room.request.RoomStorageLogSearchParamRequest; 8 | 9 | public interface RoomStorageLogService extends IService { 10 | public void saveAndUpdateStorage(RoomStorageLog roomStorageLog); 11 | 12 | // 查询多参数 13 | public IPage getByQueryParams(Page page, RoomStorageLogSearchParamRequest params); 14 | } 15 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/room/RoomStorageService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.room; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.room.RoomStorage; 7 | import com.drug.web.room.request.RoomStorageSearchParamRequest; 8 | 9 | public interface RoomStorageService extends IService { 10 | // 更新库存 11 | public int updateNumByDrugId(Integer drugId, Integer num); 12 | 13 | // 查询多参数 14 | public IPage getByQueryParams(Page page, RoomStorageSearchParamRequest params); 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/room/impl/RoomSendServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.room.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.room.RoomSendMapper; 7 | import com.drug.dao.room.RoomStorageMapper; 8 | import com.drug.entity.room.RoomSend; 9 | import com.drug.entity.room.RoomStorage; 10 | import com.drug.service.room.RoomSendService; 11 | import com.drug.utils.UserUtil; 12 | import com.drug.web.room.request.RoomSendRequest; 13 | import com.drug.web.room.request.RoomSendSearchParamRequest; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Service; 16 | 17 | import java.util.Date; 18 | 19 | @Service 20 | public class RoomSendServiceImpl extends ServiceImpl implements RoomSendService { 21 | 22 | @Autowired 23 | private RoomStorageMapper roomStorageMapper; 24 | 25 | @Autowired 26 | private RoomSendMapper roomSendMapper; 27 | 28 | @Override 29 | public synchronized void saveAndUpdateStorage(RoomSendRequest roomSendRequest) { 30 | for(RoomSendRequest.RoomSendRequestDrug roomSendRequestDrug : roomSendRequest.getRoomSendRequestDrugs()) { 31 | Integer drugId = roomSendRequestDrug.getDrugId(); 32 | Integer num = roomSendRequestDrug.getNum() * -1; // 发药为减库存 33 | 34 | // 目前库存 35 | RoomStorage roomStorage = roomStorageMapper.getByDrugId(drugId); 36 | // 在save check 已验证 此处不再验证 37 | // 根据类型设置 数量 - 符号 38 | roomStorageMapper.updateNumByDrugId(drugId, num); 39 | 40 | // 生成 send 对象 41 | RoomSend roomSend = new RoomSend(); 42 | roomSend.setOperatorEndNum(roomStorageMapper.getByDrugId(drugId).getStockNum());// 操作后库存 43 | roomSend.setCreateTime(new Date()); 44 | roomSend.setUserId(UserUtil.getCurrentPrincipal().getId()); 45 | roomSend.setDrugId(drugId); 46 | roomSend.setNum(num); 47 | roomSend.setRegisterId(roomSendRequest.getRegisterId()); 48 | roomSendMapper.insert(roomSend); 49 | } 50 | } 51 | 52 | @Override 53 | public IPage getByQueryParams(Page page, RoomSendSearchParamRequest params) { 54 | return roomSendMapper.getByQueryParams(page, params); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/room/impl/RoomStorageLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.room.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.room.RoomStorageLogMapper; 7 | import com.drug.dao.room.RoomStorageMapper; 8 | import com.drug.entity.room.RoomStorage; 9 | import com.drug.entity.room.RoomStorageLog; 10 | import com.drug.entity.storage.StorageOperatorTypeEnum; 11 | import com.drug.service.room.RoomStorageLogService; 12 | import com.drug.web.room.request.RoomStorageLogSearchParamRequest; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Service; 15 | 16 | @Service 17 | public class RoomStorageLogServiceImpl extends ServiceImpl implements RoomStorageLogService { 18 | 19 | @Autowired 20 | private RoomStorageMapper roomStorageMapper; 21 | 22 | @Autowired 23 | private RoomStorageLogMapper roomStorageLogMapper; 24 | 25 | @Override 26 | public synchronized void saveAndUpdateStorage(RoomStorageLog roomStorageLog) { 27 | RoomStorage roomStorage = roomStorageMapper.getByDrugId(roomStorageLog.getDrugId()); 28 | if(roomStorage == null) { 29 | roomStorage = new RoomStorage(); 30 | roomStorage.setStockNum(roomStorageLog.getNum()); 31 | roomStorage.setDrugId(roomStorageLog.getDrugId()); 32 | roomStorageMapper.insert(roomStorage); 33 | } else { 34 | // 根据类型设置 数量 + - 符号 35 | if(roomStorageLog.getOperatorType() == StorageOperatorTypeEnum.DAMAGE.getId() 36 | || roomStorageLog.getOperatorType() == StorageOperatorTypeEnum.DEPARTMENT.getId()) { 37 | roomStorageLog.setNum(roomStorageLog.getNum() * -1); 38 | } 39 | roomStorageMapper.updateNumByDrugId(roomStorageLog.getDrugId(), roomStorageLog.getNum()); 40 | } 41 | roomStorageLog.setOperatorEndNum(roomStorageMapper.getByDrugId(roomStorageLog.getDrugId()).getStockNum()); 42 | roomStorageLogMapper.insert(roomStorageLog); 43 | } 44 | 45 | @Override 46 | public IPage getByQueryParams(Page page, RoomStorageLogSearchParamRequest params) { 47 | return roomStorageLogMapper.getByQueryParams(page, params); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/room/impl/RoomStorageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.room.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.room.RoomStorageMapper; 7 | import com.drug.entity.room.RoomStorage; 8 | import com.drug.service.room.RoomStorageService; 9 | import com.drug.web.room.request.RoomStorageSearchParamRequest; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | @Service 14 | public class RoomStorageServiceImpl extends ServiceImpl implements RoomStorageService { 15 | 16 | @Autowired 17 | private RoomStorageMapper roomStorageMapper; 18 | 19 | @Override 20 | public synchronized int updateNumByDrugId(Integer drugId, Integer num) { 21 | return roomStorageMapper.updateNumByDrugId(drugId, num); 22 | } 23 | 24 | @Override 25 | public IPage getByQueryParams(Page page, RoomStorageSearchParamRequest params) { 26 | return roomStorageMapper.getByQueryParams(page, params); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/storage/StorageLogService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.storage; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.storage.DrugStorageLog; 7 | import com.drug.web.storage.request.StorageLogSearchParamRequest; 8 | 9 | public interface StorageLogService extends IService { 10 | public void saveAndUpdateStorage(DrugStorageLog drugStorageLog); 11 | 12 | // 查询多参数 13 | public IPage getByQueryParams(Page page, StorageLogSearchParamRequest params); 14 | } 15 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/storage/StorageService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.storage; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.drug.entity.storage.DrugStorage; 7 | import com.drug.web.storage.request.StorageSearchParamRequest; 8 | 9 | public interface StorageService extends IService { 10 | // 更新库存 11 | public int updateNumByDrugId(Integer drugId, Integer num); 12 | 13 | // 查询多参数 14 | public IPage getByQueryParams(Page page, StorageSearchParamRequest params); 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/storage/impl/StorageLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.storage.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.storage.StorageLogMapper; 7 | import com.drug.dao.storage.StorageMapper; 8 | import com.drug.entity.storage.DrugStorage; 9 | import com.drug.entity.storage.DrugStorageLog; 10 | import com.drug.entity.storage.StorageOperatorTypeEnum; 11 | import com.drug.service.storage.StorageLogService; 12 | import com.drug.web.storage.request.StorageLogSearchParamRequest; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Service; 15 | 16 | @Service 17 | public class StorageLogServiceImpl extends ServiceImpl implements StorageLogService { 18 | 19 | @Autowired 20 | private StorageMapper storageMapper; 21 | 22 | @Autowired 23 | private StorageLogMapper storageLogMapper; 24 | 25 | @Override 26 | public synchronized void saveAndUpdateStorage(DrugStorageLog drugStorageLog) { 27 | DrugStorage drugStorage = storageMapper.getByDrugId(drugStorageLog.getDrugId()); 28 | if(drugStorage == null) { 29 | drugStorage = new DrugStorage(); 30 | drugStorage.setStockNum(drugStorageLog.getNum()); 31 | drugStorage.setDrugId(drugStorageLog.getDrugId()); 32 | storageMapper.insert(drugStorage); 33 | } else { 34 | // 根据类型设置 数量 + - 符号 35 | if(drugStorageLog.getOperatorType() == StorageOperatorTypeEnum.DAMAGE.getId() 36 | || drugStorageLog.getOperatorType() == StorageOperatorTypeEnum.DEPARTMENT.getId()) { 37 | drugStorageLog.setNum(drugStorageLog.getNum() * -1); 38 | } 39 | storageMapper.updateNumByDrugId(drugStorageLog.getDrugId(), drugStorageLog.getNum()); 40 | } 41 | drugStorageLog.setOperatorEndNum(storageMapper.getByDrugId(drugStorageLog.getDrugId()).getStockNum()); 42 | storageLogMapper.insert(drugStorageLog); 43 | } 44 | 45 | @Override 46 | public IPage getByQueryParams(Page page, StorageLogSearchParamRequest params) { 47 | return storageLogMapper.getByQueryParams(page, params); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/storage/impl/StorageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.storage.impl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.drug.dao.storage.StorageMapper; 7 | import com.drug.entity.storage.DrugStorage; 8 | import com.drug.service.storage.StorageService; 9 | import com.drug.web.storage.request.StorageSearchParamRequest; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | @Service 14 | public class StorageServiceImpl extends ServiceImpl implements StorageService { 15 | 16 | @Autowired 17 | private StorageMapper storageMapper; 18 | 19 | @Override 20 | public synchronized int updateNumByDrugId(Integer drugId, Integer num) { 21 | return storageMapper.updateNumByDrugId(drugId, num); 22 | } 23 | 24 | @Override 25 | public IPage getByQueryParams(Page page, StorageSearchParamRequest params) { 26 | return storageMapper.getByQueryParams(page, params); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/PermissionService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.user.Permission; 5 | 6 | import java.util.List; 7 | 8 | 9 | public interface PermissionService extends IService { 10 | 11 | // List getPermissionsByRoleName(String roleName); 12 | 13 | List getPermissionUrlsByRoleName(String roleName); 14 | 15 | List loadPermission(Integer permissionId); 16 | 17 | List loadItemPermission(Integer roleId); 18 | 19 | List loadNoParentPermission(); 20 | 21 | List findPermissionByRoleId(Integer roleId); 22 | 23 | List findItemRoot(); 24 | 25 | Integer deletePermissionByRoleId(Integer roleId); 26 | 27 | Permission findById(Integer id); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/RolePermissionService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.user.RolePermission; 5 | 6 | import java.util.List; 7 | 8 | public interface RolePermissionService extends IService { 9 | public Integer deleteByRoleId(Integer roleId); 10 | 11 | public void deleteOldAndSaveNewByRoleId(Integer roleId, List permissionIds); 12 | } 13 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/RoleService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.user.Role; 5 | 6 | import java.util.List; 7 | 8 | public interface RoleService extends IService { 9 | public List getRolesByUserId(Integer userId); 10 | } 11 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/UserLoginLogService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.user.UserLoginLog; 5 | 6 | public interface UserLoginLogService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/UserService.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.drug.entity.user.User; 5 | 6 | import java.util.Set; 7 | 8 | public interface UserService extends IService { 9 | public void saveUserAndRoles (User user, Set roleIds); 10 | } 11 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/impl/PermissionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.user.PermissionMapper; 5 | import com.drug.entity.user.Permission; 6 | import com.drug.service.user.PermissionService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | public class PermissionServiceImpl extends ServiceImpl implements PermissionService { 14 | 15 | @Autowired 16 | protected PermissionMapper permissionDao; 17 | 18 | // @Override 19 | // public List getPermissionsByRoleName(String roleName) { 20 | // // TODO Auto-generated method stub 21 | // return permissionDao.getPermissionsByRoleName(roleName); 22 | // } 23 | 24 | @Override 25 | public List getPermissionUrlsByRoleName(String roleName) { 26 | // TODO Auto-generated method stub 27 | return permissionDao.getPermissionUrlsByRoleName(roleName); 28 | } 29 | 30 | @Override 31 | public List loadPermission(Integer permissionId) { 32 | // TODO Auto-generated method stub 33 | return permissionDao.loadPermission(permissionId); 34 | } 35 | 36 | @Override 37 | public List loadNoParentPermission() { 38 | // TODO Auto-generated method stub 39 | return permissionDao.loadNoParentPermission(); 40 | } 41 | 42 | @Override 43 | public List findPermissionByRoleId(Integer roleId) { 44 | // TODO Auto-generated method stub 45 | return permissionDao.findPermissionByRoleId(roleId); 46 | } 47 | 48 | @Override 49 | public Integer deletePermissionByRoleId(Integer roleId) { 50 | // TODO Auto-generated method stub 51 | return permissionDao.deletePermissionByRoleId(roleId); 52 | } 53 | 54 | @Override 55 | public Permission findById(Integer id) { 56 | // TODO Auto-generated method stub 57 | return permissionDao.selectById(id); 58 | } 59 | 60 | @Override 61 | public List loadItemPermission(Integer roleId) { 62 | // TODO Auto-generated method stub 63 | return permissionDao.loadItemPermission(roleId); 64 | } 65 | 66 | @Override 67 | public List findItemRoot() { 68 | // TODO Auto-generated method stub 69 | return permissionDao.findItemRoot(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/impl/RolePermissionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.user.PermissionMapper; 5 | import com.drug.dao.user.RolePermissionMapper; 6 | import com.drug.entity.user.RolePermission; 7 | import com.drug.service.user.RolePermissionService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class RolePermissionServiceImpl extends ServiceImpl implements RolePermissionService { 15 | 16 | @Autowired 17 | private RolePermissionMapper rolePermissionMapper; 18 | 19 | @Autowired 20 | private PermissionMapper permissionMapper; 21 | 22 | @Override 23 | public Integer deleteByRoleId(Integer roleId) { 24 | return rolePermissionMapper.deleteByRoleId(roleId); 25 | } 26 | 27 | @Override 28 | public void deleteOldAndSaveNewByRoleId(Integer roleId, List permissionIds) { 29 | rolePermissionMapper.deleteByRoleId(roleId); 30 | 31 | for(Integer pid : permissionIds) { 32 | List allParentsAndSelfIds = permissionMapper.getAllParentsAndSelfById(pid); 33 | for (Integer parentAndSelfId : allParentsAndSelfIds) { 34 | RolePermission rolePermission = new RolePermission(roleId, parentAndSelfId); 35 | rolePermissionMapper.insert(rolePermission); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.user.PermissionMapper; 5 | import com.drug.entity.user.Role; 6 | import com.drug.service.user.RoleService; 7 | import com.drug.dao.user.RoleMapper; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class RoleServiceImpl extends ServiceImpl implements RoleService { 15 | 16 | @Autowired 17 | private RoleMapper roleDao; 18 | 19 | @Autowired 20 | private PermissionMapper permissionMapper; 21 | 22 | public List getRolesByUserId(Integer userId) { 23 | List roles = roleDao.getRolesByUserId(userId); 24 | roles.forEach(item->{ 25 | item.setPermissionNames(permissionMapper.getPermissionsByRoleId(item.getId())); 26 | }); 27 | return roleDao.getRolesByUserId(userId); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/impl/UserLoginLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.user.UserLoginLogMapper; 5 | import com.drug.entity.user.UserLoginLog; 6 | import com.drug.service.user.UserLoginLogService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class UserLoginLogServiceImpl extends ServiceImpl implements UserLoginLogService { 11 | } 12 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/service/user/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.drug.service.user.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.drug.dao.user.UserMapper; 5 | import com.drug.entity.user.User; 6 | import com.drug.dao.user.UserRoleMapper; 7 | import com.drug.entity.user.UserRole; 8 | import com.drug.service.user.UserService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.Set; 13 | 14 | @Service 15 | public class UserServiceImpl extends ServiceImpl implements UserService { 16 | 17 | @Autowired 18 | private UserMapper userMapper; 19 | 20 | @Autowired 21 | private UserRoleMapper userRoleMapper; 22 | 23 | @Override 24 | public void saveUserAndRoles(User user, Set roleIds) { 25 | if(user.getId() == null) { 26 | userMapper.insert(user); 27 | } else { 28 | // 删除之前的权限 29 | userRoleMapper.deleteByUserId(user.getId()); 30 | // 更新用户 31 | userMapper.updateById(user); 32 | } 33 | 34 | // 新增新的权限 35 | for(Integer roleId : roleIds) { 36 | UserRole userRole = new UserRole(); 37 | userRole.setUserId(user.getId()); 38 | userRole.setRoleId(roleId); 39 | userRoleMapper.insert(userRole); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/utils/UserUtil.java: -------------------------------------------------------------------------------- 1 | package com.drug.utils; 2 | 3 | import com.drug.entity.user.User; 4 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 5 | import org.springframework.security.core.context.SecurityContextHolder; 6 | 7 | public class UserUtil { 8 | 9 | /** 10 | * 获取当前用户对象 11 | * @return 12 | */ 13 | public static UsernamePasswordAuthenticationToken getCurrentUserAuthentication(){ 14 | return (UsernamePasswordAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); 15 | } 16 | 17 | 18 | /** 19 | * 获取当前用户登陆权限信息 20 | * @return 21 | */ 22 | public static User getCurrentPrincipal(){ 23 | 24 | User user = (User) SecurityContextHolder.getContext() 25 | .getAuthentication() 26 | .getPrincipal(); 27 | return user; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/common/BaseCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.common; 2 | 3 | import java.io.IOException; 4 | import java.text.DateFormat; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.propertyeditors.CustomDateEditor; 11 | import org.springframework.web.bind.WebDataBinder; 12 | import org.springframework.web.bind.annotation.InitBinder; 13 | 14 | import com.fasterxml.jackson.core.JsonGenerator; 15 | import com.fasterxml.jackson.core.JsonProcessingException; 16 | import com.fasterxml.jackson.databind.JsonSerializer; 17 | import com.fasterxml.jackson.databind.SerializerProvider; 18 | 19 | public abstract class BaseCtrl extends JsonSerializer{ 20 | 21 | protected HttpServletRequest request; 22 | 23 | @InitBinder 24 | public void initBinder(WebDataBinder binder) { 25 | DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); 26 | dateFormat.setLenient(true); 27 | binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); 28 | } 29 | 30 | //前台输入为yyyy-MM....时间格式 31 | @Override 32 | public void serialize(Date value, JsonGenerator gen, SerializerProvider serializers) 33 | throws IOException, JsonProcessingException { 34 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 35 | String formattedDate = formatter.format(value); 36 | gen.writeString(formattedDate); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/customer/CustomerTypeCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.customer; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.drug.api.APIResult; 6 | import com.drug.api.response.CommonPageRequest; 7 | import com.drug.entity.customer.CustomerType; 8 | import com.drug.service.customer.CustomerTypeService; 9 | import io.swagger.annotations.ApiImplicitParam; 10 | import io.swagger.annotations.ApiOperation; 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import java.util.List; 18 | 19 | @RestController 20 | @RequestMapping("/customerType") 21 | public class CustomerTypeCtrl { 22 | 23 | @Autowired 24 | private CustomerTypeService customerTypeService; 25 | 26 | @RequestMapping(value = "/list/", method = RequestMethod.GET) 27 | @ResponseBody 28 | public List findCustomerAll() { 29 | //获取所有的 30 | return customerTypeService.list(); 31 | } 32 | 33 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 34 | @ResponseBody 35 | public Page list(@RequestBody CommonPageRequest pageRequest) { 36 | 37 | Integer currentPage = pageRequest.getCurrentPage(); 38 | Integer size = pageRequest.getPageSize(); 39 | Object keyword = pageRequest.getKeyword(); 40 | //初始化page 41 | Page page = new Page(currentPage, size); 42 | 43 | //设置条件 44 | QueryWrapper wrapper =new QueryWrapper(); 45 | //eq是等于,ge是大于等于,gt是大于,le是小于等于,lt是小于,like是模糊查询 46 | if(!StringUtils.isEmpty(keyword.toString())){ 47 | wrapper.like("name", keyword); 48 | } 49 | 50 | //执行查询 51 | Page customers = customerTypeService.page(page, wrapper); 52 | return customers; 53 | } 54 | 55 | @RequestMapping(value = "/save/", method = RequestMethod.POST) 56 | @ResponseBody 57 | public APIResult addCustomer(@RequestBody CustomerType customerType) { 58 | customerTypeService.saveOrUpdate(customerType); 59 | return APIResult.newSuccessResult(); 60 | } 61 | 62 | @ApiOperation(value = "根据ID加载详情") 63 | @ApiImplicitParam(dataType = "int", example = "1", required = true, name = "id", allowEmptyValue = false, value = "ID") 64 | @RequestMapping(value = "/loadDetail/{id:[0-9]+}", method = RequestMethod.GET) 65 | @ResponseBody 66 | public CustomerType loadDetail(@PathVariable(name = "id") Integer id, HttpServletRequest request, HttpServletResponse response) { 67 | //获取当前对象 68 | CustomerType customerType = customerTypeService.getById(id); 69 | return customerType; 70 | } 71 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/db/DbCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.db; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.drug.api.APIResult; 7 | import com.drug.api.response.CommonPageRequest; 8 | import com.drug.entity.DBBackLog; 9 | import com.drug.service.db.DBService; 10 | import com.drug.utils.UserUtil; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import java.io.File; 15 | import java.util.Date; 16 | 17 | @RestController 18 | @RequestMapping("/db") 19 | public class DbCtrl { 20 | 21 | @Autowired 22 | private DBService dbService; 23 | 24 | 25 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 26 | @ResponseBody 27 | public Page list(@RequestBody CommonPageRequest pageRequest) { 28 | 29 | Integer currentPage = pageRequest.getCurrentPage(); 30 | Integer size = pageRequest.getPageSize(); 31 | Object keyword = pageRequest.getKeyword(); 32 | //初始化page 33 | Page page = new Page(currentPage, size); 34 | 35 | //设置条件 36 | QueryWrapper wrapper =new QueryWrapper(); 37 | //执行查询 38 | Page dbs = dbService.page(page, wrapper); 39 | return dbs; 40 | } 41 | 42 | @RequestMapping(value = "/create/", method = RequestMethod.GET) 43 | @ResponseBody 44 | public APIResult create() { 45 | DBBackLog db = new DBBackLog(); 46 | db.setBackTime(new Date()); 47 | db.setUserName(UserUtil.getCurrentPrincipal().getUsername()); 48 | dbService.save(db); 49 | // 执行数据库备份 50 | try { 51 | dbBackUp("root", "123456qwe", "drug", "c:", "drug"+ DateUtil.currentSeconds()+".sql"); 52 | } catch (Exception e) { 53 | e.printStackTrace(); 54 | } 55 | 56 | return APIResult.newSuccessResult(); 57 | } 58 | 59 | /** 60 | * 备份数据库db 61 | * @param root 62 | * @param pwd 63 | * @param dbName 64 | * @param backPath 65 | * @param backName 66 | */ 67 | public static void dbBackUp(String root,String pwd,String dbName,String backPath,String backName) throws Exception { 68 | String pathSql = backPath+backName; 69 | File fileSql = new File(pathSql); 70 | //创建备份sql文件 71 | if (!fileSql.exists()){ 72 | fileSql.createNewFile(); 73 | } 74 | //mysqldump -hlocalhost -uroot -p123456 db > /home/back.sql 75 | StringBuffer sb = new StringBuffer(); 76 | sb.append("mysqldump"); 77 | sb.append(" -h127.0.0.1"); 78 | sb.append(" -u"+root); 79 | sb.append(" -p"+pwd); 80 | sb.append(" "+dbName+" >"); 81 | sb.append(pathSql); 82 | Runtime runtime = Runtime.getRuntime(); 83 | Process process = runtime.exec("cmd /c"+sb.toString()); 84 | } 85 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/drug/DrugTypeCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.drug; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.drug.api.APIResult; 6 | import com.drug.api.response.CommonPageRequest; 7 | import com.drug.entity.drug.DrugType; 8 | import com.drug.service.drug.DrugTypeService; 9 | import io.swagger.annotations.ApiImplicitParam; 10 | import io.swagger.annotations.ApiOperation; 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import java.util.List; 18 | 19 | @RestController 20 | @RequestMapping("/drugType") 21 | public class DrugTypeCtrl { 22 | 23 | @Autowired 24 | private DrugTypeService drugTypeService; 25 | 26 | @RequestMapping(value = "/list/", method = RequestMethod.GET) 27 | @ResponseBody 28 | public List findDrugAll() { 29 | //获取所有的 30 | return drugTypeService.list(); 31 | } 32 | 33 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 34 | @ResponseBody 35 | public Page list(@RequestBody CommonPageRequest pageRequest) { 36 | 37 | Integer currentPage = pageRequest.getCurrentPage(); 38 | Integer size = pageRequest.getPageSize(); 39 | Object keyword = pageRequest.getKeyword(); 40 | //初始化page 41 | Page page = new Page(currentPage, size); 42 | 43 | //设置条件 44 | QueryWrapper wrapper =new QueryWrapper(); 45 | //eq是等于,ge是大于等于,gt是大于,le是小于等于,lt是小于,like是模糊查询 46 | if(!StringUtils.isEmpty(keyword.toString())){ 47 | wrapper.like("name", keyword); 48 | } 49 | 50 | //执行查询 51 | Page drugs = drugTypeService.page(page, wrapper); 52 | return drugs; 53 | } 54 | 55 | @RequestMapping(value = "/save/", method = RequestMethod.POST) 56 | @ResponseBody 57 | public APIResult addDrug(@RequestBody DrugType drugType) { 58 | drugTypeService.saveOrUpdate(drugType); 59 | return APIResult.newSuccessResult(); 60 | } 61 | 62 | @ApiOperation(value = "根据ID加载详情") 63 | @ApiImplicitParam(dataType = "int", example = "1", required = true, name = "id", allowEmptyValue = false, value = "ID") 64 | @RequestMapping(value = "/loadDetail/{id:[0-9]+}", method = RequestMethod.GET) 65 | @ResponseBody 66 | public DrugType loadDetail(@PathVariable(name = "id") Integer id, HttpServletRequest request, HttpServletResponse response) { 67 | //获取当前对象 68 | DrugType drugType = drugTypeService.getById(id); 69 | return drugType; 70 | } 71 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/drug/request/DrugRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.drug.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.drug.Drug; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | import org.springframework.beans.BeanUtils; 10 | 11 | import java.util.Date; 12 | 13 | @ApiModel(description="保存/修改请求参数") 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | public class DrugRequest extends BaseRequest { 18 | 19 | protected String name; 20 | protected Date buyDate; 21 | protected Integer typeId; 22 | protected Integer prescriptionType; 23 | protected String company; 24 | protected String specifications; 25 | protected Integer userId; 26 | protected Date createTime; 27 | protected Double price; 28 | 29 | /** 30 | * 根据REQUEST参数组装ROLE对象 31 | */ 32 | public static Drug parseRequest(DrugRequest request, Drug drug){ 33 | if(drug == null){ 34 | drug = new Drug(); 35 | } 36 | BeanUtils.copyProperties(request, drug); 37 | return drug; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/drug/response/DrugResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.drug.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.drug.Drug; 5 | import com.drug.entity.drug.DrugType; 6 | import io.swagger.annotations.ApiModel; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.util.List; 12 | 13 | @ApiModel(description="保存/修改请求参数") 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | public class DrugResponse extends BaseRequest { 18 | 19 | protected List types; 20 | protected Drug drug; 21 | 22 | /** 23 | * 根据REQUEST参数组装ROLE对象 24 | */ 25 | public static DrugResponse parseResponse(Drug drug){ 26 | return parseResponse(drug, null); 27 | } 28 | 29 | /** 30 | * 根据REQUEST参数组装ROLE对象 31 | */ 32 | public static DrugResponse parseResponse(Drug drug, List drugTypes){ 33 | DrugResponse drugResponse = new DrugResponse(); 34 | drugResponse.setDrug(drug); 35 | if(drugTypes != null ) { 36 | drugResponse.setTypes(drugTypes); 37 | } 38 | return drugResponse; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/GoodsCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.drug.api.APIResult; 6 | import com.drug.api.response.CommonPageRequest; 7 | import com.drug.entity.goods.Goods; 8 | import com.drug.service.goods.GoodsService; 9 | import com.drug.utils.UserUtil; 10 | import com.drug.web.goods.request.GoodsRequest; 11 | import com.drug.web.goods.response.GoodsResponse; 12 | import io.swagger.annotations.ApiImplicitParam; 13 | import io.swagger.annotations.ApiOperation; 14 | import org.apache.commons.lang3.StringUtils; 15 | import org.springframework.beans.factory.annotation.Autowired; 16 | import org.springframework.web.bind.annotation.*; 17 | 18 | import javax.servlet.http.HttpServletRequest; 19 | import javax.servlet.http.HttpServletResponse; 20 | import java.util.Date; 21 | import java.util.List; 22 | 23 | @RestController 24 | @RequestMapping("/goods") 25 | public class GoodsCtrl { 26 | 27 | @Autowired 28 | private GoodsService goodsService; 29 | 30 | @RequestMapping(value = "/list/", method = RequestMethod.GET) 31 | @ResponseBody 32 | public List findGoodsAll() { 33 | //获取所有的 34 | return goodsService.list(); 35 | } 36 | 37 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 38 | @ResponseBody 39 | public Page list(@RequestBody CommonPageRequest pageRequest) { 40 | 41 | Integer currentPage = pageRequest.getCurrentPage(); 42 | Integer size = pageRequest.getPageSize(); 43 | Object keyword = pageRequest.getKeyword(); 44 | //初始化page 45 | Page page = new Page(currentPage, size); 46 | 47 | //设置条件 48 | QueryWrapper wrapper =new QueryWrapper(); 49 | //eq是等于,ge是大于等于,gt是大于,le是小于等于,lt是小于,like是模糊查询 50 | if(!StringUtils.isEmpty(keyword.toString())){ 51 | wrapper.like("name", keyword); 52 | } 53 | //执行查询 54 | Page goods = goodsService.page(page, wrapper); 55 | return goods; 56 | } 57 | 58 | @RequestMapping(value = "/save/", method = RequestMethod.POST) 59 | @ResponseBody 60 | public APIResult addGoods(@RequestBody GoodsRequest goodsRequest) { 61 | //新建对象 62 | Goods goods = null; 63 | //判断ID不为空 64 | if (goodsRequest.getId() != null) { 65 | //根据ID查询对象 66 | goods = goodsService.getById(goodsRequest.getId()); 67 | } 68 | //获取修改后的对象 69 | goods = GoodsRequest.parseRequest(goodsRequest, goods); 70 | 71 | if (goodsRequest.getId() == null) { 72 | goods.setUserId(UserUtil.getCurrentPrincipal().getId()); 73 | goods.setCreateTime(new Date()); 74 | } 75 | 76 | //保存对象 77 | goodsService.saveOrUpdate(goods); 78 | return APIResult.newSuccessResult(); 79 | } 80 | 81 | @ApiOperation(value = "根据ID加载详情") 82 | @ApiImplicitParam(dataType = "int", example = "1", required = true, name = "id", allowEmptyValue = false, value = "ID") 83 | @RequestMapping(value = "/loadDetail/{id:[0-9]+}", method = RequestMethod.GET) 84 | @ResponseBody 85 | public GoodsResponse loadDetail(@PathVariable(name = "id") Integer id, HttpServletRequest request, HttpServletResponse response) { 86 | //获取当前对象 87 | Goods goods = goodsService.getById(id); 88 | GoodsResponse goodsResponse = GoodsResponse.parseResponse(goods); 89 | return goodsResponse; 90 | } 91 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/GoodsStorageCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.drug.api.APIResult; 7 | import com.drug.common.Constant; 8 | import com.drug.entity.goods.GoodsStorage; 9 | import com.drug.service.goods.GoodsService; 10 | import com.drug.service.goods.GoodsStorageService; 11 | import com.drug.web.goods.request.GoodsStorageSearchParamRequest; 12 | import io.swagger.annotations.ApiImplicitParam; 13 | import io.swagger.annotations.ApiOperation; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.*; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.servlet.http.HttpServletResponse; 19 | import java.util.List; 20 | 21 | @RestController 22 | @RequestMapping("/goodsStorage") 23 | public class GoodsStorageCtrl { 24 | 25 | @Autowired 26 | private GoodsStorageService goodsStorageService; 27 | 28 | @Autowired 29 | private GoodsService goodsService; 30 | 31 | @RequestMapping(value = "/list/", method = RequestMethod.GET) 32 | @ResponseBody 33 | public List findGoodsAll() { 34 | //获取所有的 35 | return goodsStorageService.list(); 36 | } 37 | 38 | // 查询库存小于50的 39 | @RequestMapping(value = "/list/charts/", method = RequestMethod.GET) 40 | @ResponseBody 41 | public List findDrugLe50All() { 42 | //设置条件 43 | QueryWrapper wrapper =new QueryWrapper(); 44 | //eq是等于,ge是大于等于,gt是大于,le是小于等于,lt是小于,like是模糊查询 45 | wrapper.le("stock_num", Constant.WARN_STORAGE_NUM); 46 | //获取所有的 47 | List list = goodsStorageService.list(wrapper); 48 | list.forEach(item -> { 49 | item.setGoodsName(goodsService.getById(item.getGoodsId()).getName()); 50 | }); 51 | return list; 52 | } 53 | 54 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 55 | @ResponseBody 56 | public IPage list(@RequestBody GoodsStorageSearchParamRequest pageRequest) { 57 | 58 | Integer currentPage = pageRequest.getCurrentPage(); 59 | Integer size = pageRequest.getPageSize(); 60 | //初始化page 61 | Page page = new Page(currentPage, size); 62 | IPage goodsStorages = goodsStorageService.getByQueryParams(page, pageRequest); 63 | goodsStorages.getRecords().forEach(item->{ 64 | if(item.getGoodsId() != null) { 65 | item.setGoodsName(goodsService.getById(item.getGoodsId()).getName()); 66 | } 67 | }); 68 | return goodsStorages; 69 | } 70 | 71 | @RequestMapping(value = "/save/", method = RequestMethod.POST) 72 | @ResponseBody 73 | public APIResult add(@RequestBody GoodsStorage goodsStorage) { 74 | goodsStorageService.updateById(goodsStorage); 75 | return APIResult.newSuccessResult(); 76 | } 77 | 78 | @ApiOperation(value = "根据ID加载详情") 79 | @ApiImplicitParam(dataType = "int", example = "1", required = true, name = "id", allowEmptyValue = false, value = "ID") 80 | @RequestMapping(value = "/loadDetail/{id:[0-9]+}", method = RequestMethod.GET) 81 | @ResponseBody 82 | public GoodsStorage loadDetail(@PathVariable(name = "id") Integer id, HttpServletRequest request, HttpServletResponse response) { 83 | //获取当前对象 84 | GoodsStorage goodsStorage = goodsStorageService.getById(id); 85 | return goodsStorage; 86 | } 87 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/request/GoodsRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.goods.Goods; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | import org.springframework.beans.BeanUtils; 11 | 12 | import java.util.Date; 13 | 14 | @EqualsAndHashCode(callSuper = true) 15 | @ApiModel(description="保存/修改请求参数") 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class GoodsRequest extends BaseRequest { 20 | 21 | protected String name; 22 | protected Integer userId; 23 | protected Date createTime; 24 | 25 | /** 26 | * 根据REQUEST参数组装ROLE对象 27 | */ 28 | public static Goods parseRequest(GoodsRequest request, Goods goods){ 29 | if(goods == null){ 30 | goods = new Goods(); 31 | } 32 | BeanUtils.copyProperties(request, goods); 33 | return goods; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/request/GoodsStorageLogSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class GoodsStorageLogSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String goodsName; 12 | protected Integer typeId; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/request/GoodsStorageSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class GoodsStorageSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String goodsName; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/response/GoodsResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.goods.Goods; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | @EqualsAndHashCode(callSuper = true) 12 | @ApiModel(description="保存/修改请求参数") 13 | @Data 14 | @AllArgsConstructor 15 | @NoArgsConstructor 16 | public class GoodsResponse extends BaseRequest { 17 | 18 | protected Goods goods; 19 | 20 | /** 21 | * 根据REQUEST参数组装对象 22 | */ 23 | public static GoodsResponse parseResponse(Goods goods){ 24 | GoodsResponse goodsResponse = new GoodsResponse(); 25 | goodsResponse.setGoods(goods); 26 | return goodsResponse; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/goods/response/GoodsStorageOperatorTypeEnumResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.goods.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.goods.GoodsOperatorTypeEnum; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | import org.springframework.beans.BeanUtils; 11 | 12 | @EqualsAndHashCode(callSuper = true) 13 | @ApiModel(description="保存/修改请求参数") 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | public class GoodsStorageOperatorTypeEnumResponse extends BaseRequest { 18 | 19 | protected String name; 20 | protected Boolean isAdd; 21 | 22 | public static GoodsStorageOperatorTypeEnumResponse parseResponse(GoodsOperatorTypeEnum type){ 23 | GoodsStorageOperatorTypeEnumResponse storageLogResponse = new GoodsStorageOperatorTypeEnumResponse(); 24 | BeanUtils.copyProperties(type, storageLogResponse); 25 | return storageLogResponse; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/nacos/ConfigController.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.nacos; 2 | 3 | import com.alibaba.nacos.api.config.annotation.NacosValue; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | @Controller 10 | @RequestMapping("config") 11 | public class ConfigController { 12 | 13 | @NacosValue(value = "${useLocalCache:false}", autoRefreshed = true) 14 | private boolean useLocalCache; 15 | 16 | @RequestMapping(value = "/get", method = RequestMethod.GET) 17 | @ResponseBody 18 | public boolean get() { 19 | return useLocalCache; 20 | } 21 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/register/request/RegisterRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.register.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.register.Register; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | import org.springframework.beans.BeanUtils; 11 | 12 | @EqualsAndHashCode(callSuper = true) 13 | @ApiModel(description="保存/修改请求参数") 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | public class RegisterRequest extends BaseRequest { 18 | 19 | protected String customerName; 20 | protected String customerNo; 21 | protected Integer customerType; 22 | 23 | /** 24 | * 根据REQUEST参数组装ROLE对象 25 | */ 26 | public static Register parseRequest(RegisterRequest request, Register register){ 27 | if(register == null){ 28 | register = new Register(); 29 | } 30 | BeanUtils.copyProperties(request, register); 31 | return register; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/register/response/RegisterResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.register.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.register.Register; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | import org.springframework.beans.BeanUtils; 11 | 12 | import java.util.Date; 13 | 14 | @EqualsAndHashCode(callSuper = true) 15 | @ApiModel(description="保存/修改请求参数") 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class RegisterResponse extends BaseRequest { 20 | 21 | protected String customerName; 22 | protected String customerNo; 23 | protected Integer customerType; 24 | protected Date createTime; 25 | 26 | /** 27 | * 根据REQUEST参数组装对象 28 | */ 29 | public static RegisterResponse parseResponse(Register register){ 30 | RegisterResponse response = new RegisterResponse(); 31 | BeanUtils.copyProperties(register, response); 32 | return response; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/room/RoomStorageCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.room; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.drug.api.APIResult; 7 | import com.drug.common.Constant; 8 | import com.drug.entity.room.RoomStorage; 9 | import com.drug.service.drug.DrugService; 10 | import com.drug.service.room.RoomStorageService; 11 | import com.drug.web.room.request.RoomStorageSearchParamRequest; 12 | import io.swagger.annotations.ApiImplicitParam; 13 | import io.swagger.annotations.ApiOperation; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.*; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.servlet.http.HttpServletResponse; 19 | import java.util.List; 20 | 21 | @RestController 22 | @RequestMapping("/roomStorage") 23 | public class RoomStorageCtrl { 24 | 25 | @Autowired 26 | private RoomStorageService roomStorageService; 27 | 28 | @Autowired 29 | private DrugService drugService; 30 | 31 | @RequestMapping(value = "/list/", method = RequestMethod.GET) 32 | @ResponseBody 33 | public List findDrugAll() { 34 | //获取所有的 35 | return roomStorageService.list(); 36 | } 37 | 38 | // 查询库存小于50的 39 | @RequestMapping(value = "/list/charts/", method = RequestMethod.GET) 40 | @ResponseBody 41 | public List findDrugLe50All() { 42 | //设置条件 43 | QueryWrapper wrapper =new QueryWrapper(); 44 | //eq是等于,ge是大于等于,gt是大于,le是小于等于,lt是小于,like是模糊查询 45 | wrapper.le("stock_num", Constant.WARN_STORAGE_NUM); 46 | //获取所有的 47 | List list = roomStorageService.list(wrapper); 48 | list.forEach(item -> { 49 | item.setDrugName(drugService.getById(item.getDrugId()).getName()); 50 | }); 51 | return list; 52 | } 53 | 54 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 55 | @ResponseBody 56 | public IPage list(@RequestBody RoomStorageSearchParamRequest pageRequest) { 57 | 58 | Integer currentPage = pageRequest.getCurrentPage(); 59 | Integer size = pageRequest.getPageSize(); 60 | //初始化page 61 | Page page = new Page(currentPage, size); 62 | 63 | IPage roomStorageServices = roomStorageService.getByQueryParams(page, pageRequest); 64 | roomStorageServices.getRecords().forEach(item->{ 65 | if(item.getDrugId() != null) { 66 | item.setDrugName(drugService.getById(item.getDrugId()).getName()); 67 | } 68 | }); 69 | 70 | return roomStorageServices; 71 | } 72 | 73 | @RequestMapping(value = "/save/", method = RequestMethod.POST) 74 | @ResponseBody 75 | public APIResult add(@RequestBody RoomStorage roomStorage) { 76 | roomStorageService.updateById(roomStorage); 77 | return APIResult.newSuccessResult(); 78 | } 79 | 80 | @ApiOperation(value = "根据ID加载详情") 81 | @ApiImplicitParam(dataType = "int", example = "1", required = true, name = "id", allowEmptyValue = false, value = "ID") 82 | @RequestMapping(value = "/loadDetail/{id:[0-9]+}", method = RequestMethod.GET) 83 | @ResponseBody 84 | public RoomStorage loadDetail(@PathVariable(name = "id") Integer id, HttpServletRequest request, HttpServletResponse response) { 85 | //获取当前对象 86 | RoomStorage roomStorage = roomStorageService.getById(id); 87 | return roomStorage; 88 | } 89 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/room/request/RoomSendRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.room.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | import java.util.List; 8 | 9 | @EqualsAndHashCode(callSuper = true) 10 | @Data 11 | public class RoomSendRequest extends CommonPageRequest { 12 | 13 | protected List roomSendRequestDrugs; 14 | protected Integer registerId; 15 | 16 | @Data 17 | public static class RoomSendRequestDrug { 18 | public Integer num; 19 | public Integer drugId; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/room/request/RoomSendSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.room.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class RoomSendSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String drugName; 12 | protected String customerName; 13 | protected String customerNo; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/room/request/RoomStorageLogSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.room.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class RoomStorageLogSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String drugName; 12 | protected Integer typeId; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/room/request/RoomStorageSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.room.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class RoomStorageSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String drugName; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/room/response/RoomStorageOperatorTypeEnumResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.room.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.room.RoomOperatorTypeEnum; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | import org.springframework.beans.BeanUtils; 11 | 12 | @EqualsAndHashCode(callSuper = true) 13 | @ApiModel(description="保存/修改请求参数") 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | public class RoomStorageOperatorTypeEnumResponse extends BaseRequest { 18 | 19 | protected String name; 20 | protected Boolean isAdd; 21 | 22 | public static RoomStorageOperatorTypeEnumResponse parseResponse(RoomOperatorTypeEnum type){ 23 | RoomStorageOperatorTypeEnumResponse storageLogResponse = new RoomStorageOperatorTypeEnumResponse(); 24 | BeanUtils.copyProperties(type, storageLogResponse); 25 | return storageLogResponse; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/storage/StorageCtrl.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.storage; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.drug.api.APIResult; 7 | import com.drug.common.Constant; 8 | import com.drug.entity.storage.DrugStorage; 9 | import com.drug.service.drug.DrugService; 10 | import com.drug.service.storage.StorageService; 11 | import com.drug.web.storage.request.StorageSearchParamRequest; 12 | import io.swagger.annotations.ApiImplicitParam; 13 | import io.swagger.annotations.ApiOperation; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.*; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.servlet.http.HttpServletResponse; 19 | import java.util.List; 20 | 21 | @RestController 22 | @RequestMapping("/storage") 23 | public class StorageCtrl { 24 | 25 | @Autowired 26 | private StorageService drugStorageService; 27 | 28 | @Autowired 29 | private DrugService drugService; 30 | 31 | @RequestMapping(value = "/list/", method = RequestMethod.GET) 32 | @ResponseBody 33 | public List findDrugAll() { 34 | //获取所有的 35 | return drugStorageService.list(); 36 | } 37 | 38 | // 查询库存小于50的 39 | @RequestMapping(value = "/list/charts/", method = RequestMethod.GET) 40 | @ResponseBody 41 | public List findDrugLe50All() { 42 | //设置条件 43 | QueryWrapper wrapper =new QueryWrapper(); 44 | //eq是等于,ge是大于等于,gt是大于,le是小于等于,lt是小于,like是模糊查询 45 | wrapper.le("stock_num", Constant.WARN_STORAGE_NUM); 46 | //获取所有的 47 | List list = drugStorageService.list(wrapper); 48 | list.forEach(item -> { 49 | item.setDrugName(drugService.getById(item.getDrugId()).getName()); 50 | }); 51 | return list; 52 | } 53 | 54 | @RequestMapping(value = "/list/page/", method = RequestMethod.POST) 55 | @ResponseBody 56 | public IPage list(@RequestBody StorageSearchParamRequest pageRequest) { 57 | 58 | Integer currentPage = pageRequest.getCurrentPage(); 59 | Integer size = pageRequest.getPageSize(); 60 | //初始化page 61 | Page page = new Page(currentPage, size); 62 | 63 | IPage drugStorages = drugStorageService.getByQueryParams(page, pageRequest); 64 | drugStorages.getRecords().forEach(item->{ 65 | if(item.getDrugId() != null) { 66 | item.setDrugName(drugService.getById(item.getDrugId()).getName()); 67 | } 68 | }); 69 | 70 | return drugStorages; 71 | } 72 | 73 | @RequestMapping(value = "/save/", method = RequestMethod.POST) 74 | @ResponseBody 75 | public APIResult add(@RequestBody DrugStorage drugStorage) { 76 | drugStorageService.updateById(drugStorage); 77 | return APIResult.newSuccessResult(); 78 | } 79 | 80 | @ApiOperation(value = "根据ID加载详情") 81 | @ApiImplicitParam(dataType = "int", example = "1", required = true, name = "id", allowEmptyValue = false, value = "ID") 82 | @RequestMapping(value = "/loadDetail/{id:[0-9]+}", method = RequestMethod.GET) 83 | @ResponseBody 84 | public DrugStorage loadDetail(@PathVariable(name = "id") Integer id, HttpServletRequest request, HttpServletResponse response) { 85 | //获取当前对象 86 | DrugStorage drugStorage = drugStorageService.getById(id); 87 | return drugStorage; 88 | } 89 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/storage/request/StorageLogSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.storage.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class StorageLogSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String drugName; 12 | protected Integer typeId; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/storage/request/StorageSearchParamRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.storage.request; 2 | 3 | import com.drug.api.response.CommonPageRequest; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class StorageSearchParamRequest extends CommonPageRequest { 10 | 11 | protected String drugName; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/storage/response/StorageChartsResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.storage.response; 2 | 3 | import com.drug.api.request.BaseResponse; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | @EqualsAndHashCode(callSuper = true) 8 | @Data 9 | public class StorageChartsResponse extends BaseResponse { 10 | // 库存数量 11 | protected Integer storageNum; 12 | // 药品 13 | protected String drugName; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/storage/response/StorageOperatorTypeEnumResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.storage.response; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.storage.StorageOperatorTypeEnum; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | import org.springframework.beans.BeanUtils; 11 | 12 | @EqualsAndHashCode(callSuper = true) 13 | @ApiModel(description="保存/修改请求参数") 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | public class StorageOperatorTypeEnumResponse extends BaseRequest { 18 | 19 | protected String name; 20 | protected Boolean isAdd; 21 | 22 | public static StorageOperatorTypeEnumResponse parseResponse(StorageOperatorTypeEnum type){ 23 | StorageOperatorTypeEnumResponse storageLogResponse = new StorageOperatorTypeEnumResponse(); 24 | BeanUtils.copyProperties(type, storageLogResponse); 25 | return storageLogResponse; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/PermissionRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.user.Permission; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | 8 | @ApiModel(description="权限保存/修改请求参数") 9 | public class PermissionRequest extends BaseRequest { 10 | 11 | /** 12 | * 13 | */ 14 | private static final long serialVersionUID = -5901852674241024876L; 15 | 16 | @ApiModelProperty(value="权限名称") 17 | protected String name; 18 | @ApiModelProperty(value="权限描述") 19 | protected String description; 20 | @ApiModelProperty(value="所属父权限ID") 21 | protected Integer parentId; 22 | @ApiModelProperty(value="权限的Api地址") 23 | protected String url; 24 | 25 | public PermissionRequest(){ 26 | 27 | } 28 | 29 | /** 30 | * 根据REQUEST参数组装PERMISSION对象 31 | */ 32 | public static Permission parsePermissionRequest(PermissionRequest permissionRequest, Permission permission){ 33 | if(permission == null){ 34 | permission = new Permission(permissionRequest.getId()); 35 | } 36 | 37 | permission.setName(permissionRequest.getName()); 38 | permission.setDescription(permissionRequest.getDescription()); 39 | permission.setUrl(permissionRequest.getUrl()); 40 | 41 | permission.setParentId(permissionRequest.getParentId()); 42 | 43 | return permission; 44 | } 45 | 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | public void setName(String name) { 51 | this.name = name; 52 | } 53 | 54 | public String getDescription() { 55 | return description; 56 | } 57 | 58 | public void setDescription(String description) { 59 | this.description = description; 60 | } 61 | 62 | public Integer getParentId() { 63 | return parentId; 64 | } 65 | 66 | public void setParentId(Integer parentId) { 67 | this.parentId = parentId; 68 | } 69 | 70 | public String getUrl() { 71 | return url; 72 | } 73 | 74 | public void setUrl(String url) { 75 | this.url = url; 76 | } 77 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/RolePermissionRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | 7 | import java.util.Collections; 8 | import java.util.List; 9 | 10 | @ApiModel(description="角色权限保存/修改请求参数") 11 | public class RolePermissionRequest extends BaseRequest { 12 | 13 | /** 14 | * 15 | */ 16 | private static final long serialVersionUID = 9178308106083001451L; 17 | 18 | @ApiModelProperty(value="角色ID") 19 | protected Integer roleId; 20 | @ApiModelProperty(value="权限ID 查询时候用到") 21 | protected Integer permissionId; 22 | @ApiModelProperty(value="权限ID集合") 23 | protected List permissionIds = Collections.emptyList(); 24 | 25 | public RolePermissionRequest(){ 26 | 27 | } 28 | 29 | public Integer getRoleId() { 30 | return roleId; 31 | } 32 | 33 | public void setRoleId(Integer roleId) { 34 | this.roleId = roleId; 35 | } 36 | 37 | public Integer getPermissionId() { 38 | return permissionId; 39 | } 40 | 41 | public void setPermissionId(Integer permissionId) { 42 | this.permissionId = permissionId; 43 | } 44 | 45 | public List getPermissionIds() { 46 | return permissionIds; 47 | } 48 | 49 | public void setPermissionIds(List permissionIds) { 50 | this.permissionIds = permissionIds; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/RoleRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import com.drug.entity.user.Role; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | 8 | @ApiModel(description="角色保存/修改请求参数") 9 | public class RoleRequest extends BaseRequest { 10 | 11 | /** 12 | * 13 | */ 14 | private static final long serialVersionUID = 6784751020328613014L; 15 | 16 | @ApiModelProperty(value="角色名称") 17 | protected String name; 18 | @ApiModelProperty(value="角色描述") 19 | protected String description; 20 | 21 | public RoleRequest(){ 22 | 23 | } 24 | 25 | /** 26 | * 根据REQUEST参数组装ROLE对象 27 | */ 28 | public static Role parseRoleRequest(RoleRequest roleRequest, Role role){ 29 | if(role == null){ 30 | role = new Role(roleRequest.getId()); 31 | } 32 | 33 | role.setName(roleRequest.getName()); 34 | role.setDescription(roleRequest.getDescription()); 35 | return role; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | public String getDescription() { 47 | return description; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return "RoleRequest [name=" + name + ", description=" + description + "]"; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/UserCheckNameRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | import com.drug.api.request.BaseRequest; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | 7 | @ApiModel(description="用户保存/修改请求") 8 | public class UserCheckNameRequest extends BaseRequest { 9 | 10 | private static final long serialVersionUID = -5754435863291418626L; 11 | 12 | @ApiModelProperty(value="用户名") 13 | protected String name; 14 | 15 | public UserCheckNameRequest(){ 16 | 17 | } 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/UserPasswordRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | import com.drug.entity.user.User; 4 | import com.drug.api.request.BaseRequest; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 8 | 9 | @ApiModel(description="用户保存/修改请求") 10 | public class UserPasswordRequest extends BaseRequest { 11 | 12 | private static final long serialVersionUID = -5754435863291418626L; 13 | 14 | @ApiModelProperty(value="密码") 15 | protected String npsd; 16 | @ApiModelProperty(value="确认密码") 17 | protected String nconfirmPsd; 18 | 19 | public UserPasswordRequest(){ 20 | 21 | } 22 | 23 | /** 24 | * 根据REQUEST参数组装USER对象 25 | */ 26 | public static User parseUserRequest(UserPasswordRequest userPasswordRequest, User user){ 27 | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); 28 | String password = passwordEncoder.encode(userPasswordRequest.getNpsd()); 29 | user.setPassword(password); 30 | return user; 31 | } 32 | 33 | public String getNpsd() { 34 | return npsd; 35 | } 36 | 37 | public void setNpsd(String npsd) { 38 | this.npsd = npsd; 39 | } 40 | 41 | public String getNconfirmPsd() { 42 | return nconfirmPsd; 43 | } 44 | 45 | public void setNconfirmPsd(String nconfirmPsd) { 46 | this.nconfirmPsd = nconfirmPsd; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "UserRequest [npsd=" + npsd + ", nconfirmPsd=" + nconfirmPsd + "]"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/UserRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | import com.drug.entity.user.Role; 4 | import com.drug.entity.user.User; 5 | import com.drug.api.request.BaseRequest; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 | 11 | import java.util.Date; 12 | import java.util.HashSet; 13 | import java.util.Set; 14 | 15 | @ApiModel(description="用户保存/修改请求") 16 | public class UserRequest extends BaseRequest { 17 | 18 | private static final long serialVersionUID = -5754435863291418626L; 19 | 20 | @ApiModelProperty(value="用户名") 21 | protected String userName; 22 | @ApiModelProperty(value="员工英文名") 23 | protected String empName; 24 | @ApiModelProperty(value="密码") 25 | protected String password; 26 | @ApiModelProperty(value="确认密码") 27 | protected String confirmPassword; 28 | @ApiModelProperty(value="是否停用") 29 | protected String isEnable; 30 | @ApiModelProperty(value="对应角色IDS") 31 | protected Set roleIds = new HashSet(); 32 | @ApiModelProperty(value="对应角色ID") 33 | protected Integer roleId; 34 | 35 | public UserRequest(){ 36 | 37 | } 38 | 39 | /** 40 | * 根据REQUEST参数组装USER对象 41 | */ 42 | public static User parseUserRequest(UserRequest userRequest, User user){ 43 | if(user == null){ 44 | user = new User(userRequest.getId()); 45 | user.setCreateDate(new Date()); 46 | } 47 | user.setEmpName(userRequest.getEmpName()); 48 | if(userRequest.getIsEnable() != null){ 49 | if(userRequest.getIsEnable().equals("true")){ 50 | user.setIsEnable(true); 51 | }else{ 52 | user.setIsEnable(false); 53 | } 54 | } 55 | 56 | user.setUserName(userRequest.getUserName()); 57 | Set roles = new HashSet(); 58 | userRequest.getRoleIds().forEach(id -> roles.add(new Role(id))); 59 | user.setRoles(roles); 60 | if(StringUtils.isNotBlank(userRequest.getPassword())){ 61 | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); 62 | String password = passwordEncoder.encode(userRequest.getPassword()); 63 | user.setPassword(password); 64 | } 65 | 66 | return user; 67 | } 68 | 69 | public String getUserName() { 70 | return userName; 71 | } 72 | 73 | public String getEmpName() { 74 | return empName; 75 | } 76 | 77 | public String getPassword() { 78 | return password; 79 | } 80 | 81 | public Set getRoleIds() { 82 | return roleIds; 83 | } 84 | 85 | public void setUserName(String userName) { 86 | this.userName = userName; 87 | } 88 | 89 | public void setEmpName(String empName) { 90 | this.empName = empName; 91 | } 92 | 93 | public void setPassword(String password) { 94 | this.password = password; 95 | } 96 | 97 | public void setRoleIds(Set roleIds) { 98 | this.roleIds = roleIds; 99 | } 100 | 101 | public String getIsEnable() { 102 | return isEnable; 103 | } 104 | 105 | public void setIsEnable(String isEnable) { 106 | this.isEnable = isEnable; 107 | } 108 | 109 | public String getConfirmPassword() { 110 | return confirmPassword; 111 | } 112 | 113 | public void setConfirmPassword(String confirmPassword) { 114 | this.confirmPassword = confirmPassword; 115 | } 116 | 117 | public Integer getRoleId() { 118 | return roleId; 119 | } 120 | 121 | public void setRoleId(Integer roleId) { 122 | this.roleId = roleId; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/request/UserThemeRequest.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.request; 2 | 3 | 4 | import com.drug.api.request.BaseRequest; 5 | import io.swagger.annotations.ApiModel; 6 | 7 | @ApiModel(description="保存用户主题请求参数") 8 | public class UserThemeRequest extends BaseRequest { 9 | 10 | private static final long serialVersionUID = -5754435863291418626L; 11 | 12 | protected String theme; 13 | 14 | public UserThemeRequest(){ 15 | 16 | } 17 | 18 | public String getTheme() { 19 | return theme; 20 | } 21 | 22 | public void setTheme(String theme) { 23 | this.theme = theme; 24 | } 25 | } -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/response/PermissionParentResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.response; 2 | 3 | import com.drug.entity.user.Permission; 4 | 5 | import java.io.Serializable; 6 | 7 | public class PermissionParentResponse implements Serializable{ 8 | 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = -1016360465856477360L; 13 | 14 | //ID 15 | protected Integer id; 16 | //权限名称 17 | protected String name; 18 | 19 | public PermissionParentResponse(){ 20 | 21 | } 22 | 23 | public PermissionParentResponse(Permission permission){ 24 | 25 | if(permission != null){ 26 | this.id = permission.getId(); 27 | this.name = permission.getName(); 28 | } 29 | } 30 | 31 | public Integer getId() { 32 | return id; 33 | } 34 | 35 | public void setId(Integer id) { 36 | this.id = id; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | 47 | 48 | @Override 49 | public String toString() { 50 | return "PermissionResponse [id=" + id + ", name=" + name + "]"; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/response/PermissionTotalResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.response; 2 | 3 | import com.drug.utils.Collections; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | @ApiModel(description="权限列表返回结果") 11 | public class PermissionTotalResponse implements Serializable{ 12 | 13 | private static final long serialVersionUID = -1016360465856477360L; 14 | 15 | @ApiModelProperty(value="权限") 16 | protected PermissionResponse permission = new PermissionResponse(); 17 | @ApiModelProperty(value="权限集合") 18 | protected List permissions = Collections.emptyList(); 19 | 20 | public PermissionTotalResponse(){ 21 | 22 | } 23 | 24 | public PermissionResponse getPermission() { 25 | return permission; 26 | } 27 | 28 | public void setPermission(PermissionResponse permission) { 29 | this.permission = permission; 30 | } 31 | 32 | public List getPermissions() { 33 | return permissions; 34 | } 35 | 36 | public void setPermissions(List permissions) { 37 | this.permissions = permissions; 38 | } 39 | 40 | 41 | 42 | @Override 43 | public String toString() { 44 | return "PermissionTotalResponse [permission=" + permission + ", permissions=" + permissions + "]"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/response/RolePermissionResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.response; 2 | 3 | import com.drug.entity.user.Permission; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | 7 | import java.io.Serializable; 8 | import java.util.Collections; 9 | import java.util.List; 10 | 11 | @ApiModel(description="角色权限返回结果") 12 | public class RolePermissionResponse implements Serializable{ 13 | 14 | /** 15 | * 16 | */ 17 | private static final long serialVersionUID = 6939805833686667088L; 18 | 19 | @ApiModelProperty(value="类ID集合") 20 | protected List entityIds = Collections.emptyList(); 21 | @ApiModelProperty(value="权限集合") 22 | protected List permissions = Collections.emptyList(); 23 | 24 | public RolePermissionResponse(){ 25 | 26 | } 27 | 28 | public List getEntityIds() { 29 | return entityIds; 30 | } 31 | 32 | public void setEntityIds(List entityIds) { 33 | this.entityIds = entityIds; 34 | } 35 | 36 | public List getPermissions() { 37 | return permissions; 38 | } 39 | 40 | public void setPermissions(List permissions) { 41 | this.permissions = permissions; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/response/UserFromResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.response; 2 | 3 | import com.drug.api.request.BaseResponse; 4 | import com.drug.entity.user.Role; 5 | import com.drug.utils.Collections; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class UserFromResponse extends BaseResponse { 11 | 12 | private static final long serialVersionUID = -5754435863291418626L; 13 | 14 | //用户对象 15 | protected UserResponse user; 16 | //角色集合 17 | protected List roles = Collections.emptyList(); 18 | 19 | public UserFromResponse(){ 20 | 21 | } 22 | 23 | public UserResponse getUser() { 24 | return user; 25 | } 26 | 27 | public void setUser(UserResponse user) { 28 | this.user = user; 29 | } 30 | 31 | public List getRoles() { 32 | return roles; 33 | } 34 | 35 | public void setRoles(List roles) { 36 | this.roles = roles; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /drug/src/main/java/com/drug/web/user/response/UserResponse.java: -------------------------------------------------------------------------------- 1 | package com.drug.web.user.response; 2 | 3 | import com.drug.api.request.BaseResponse; 4 | import com.drug.entity.user.Role; 5 | import com.drug.entity.user.User; 6 | import com.drug.utils.Collections; 7 | 8 | public class UserResponse extends BaseResponse { 9 | 10 | private static final long serialVersionUID = -5754435863291418626L; 11 | 12 | //用户名 13 | protected String userName; 14 | //昵称 15 | protected String empName; 16 | //用户状态 17 | protected String isEnable; 18 | //部门ID 19 | protected Integer departmentId; 20 | //角色ID集合 21 | protected Integer roleId; 22 | 23 | public UserResponse(){ 24 | 25 | } 26 | 27 | public UserResponse(User user){ 28 | this.id = user.getId(); 29 | this.userName = user.getUsername(); 30 | this.empName = user.getEmpName(); 31 | 32 | if(Collections.isNotEmpty(user.getRoles())){ 33 | for(Role role : user.getRoles()){ 34 | this.roleId = role.getId(); 35 | break; 36 | } 37 | } 38 | 39 | this.isEnable = user.getIsEnable() == null ? "false" : user.getIsEnable().toString(); 40 | } 41 | 42 | 43 | public String getUserName() { 44 | return userName; 45 | } 46 | 47 | public void setUserName(String userName) { 48 | this.userName = userName; 49 | } 50 | 51 | public String getEmpName() { 52 | return empName; 53 | } 54 | 55 | public void setEmpName(String empName) { 56 | this.empName = empName; 57 | } 58 | 59 | public Integer getDepartmentId() { 60 | return departmentId; 61 | } 62 | 63 | public void setDepartmentId(Integer departmentId) { 64 | this.departmentId = departmentId; 65 | } 66 | 67 | public Integer getRoleId() { 68 | return roleId; 69 | } 70 | 71 | public void setRoleId(Integer roleId) { 72 | this.roleId = roleId; 73 | } 74 | 75 | public String getIsEnable() { 76 | return isEnable; 77 | } 78 | 79 | public void setIsEnable(String isEnable) { 80 | this.isEnable = isEnable; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /drug/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8888 2 | 3 | spring.application.name=drug-api 4 | 5 | # MULTIPART (MultipartProperties) 6 | spring.servlet.multipart.enabled=true 7 | spring.servlet.multipart.max-file-size=5MB 8 | spring.servlet.multipart.max-request-size=50MB 9 | 10 | # HTTP encoding (HttpEncodingProperties) 11 | server.servlet.encoding.charset=UTF-8 12 | server.servlet.encoding.enabled=true 13 | 14 | file_real_base_path=E:/educationProject/????/drugManageSystem/drug/images 15 | 16 | logging.level.com.baomidou.mybatisplus=INFO 17 | logging.level.org.springframework.web=INFO 18 | logging.level.com.zaxxer.hikari=INFO 19 | logging.level.com=DEBUG 20 | 21 | #MYSQL - DATASOURCE 22 | spring.datasource.url=jdbc:mysql://localhost:3306/drug?useunicode=true&characterEncoding=utf8&autoReconnect=true&serverTimezone=Asia/Shanghai 23 | spring.datasource.username=root 24 | spring.datasource.password=root 25 | spring.datasource.jdbc=com.mysql.cj.jdbc.Driver 26 | 27 | spring.datasource.type=com.zaxxer.hikari.HikariDataSource 28 | spring.datasource.minimum-idle=5 29 | spring.datasource.idle-timeout=90000 30 | spring.datasource.max-idle=10 31 | spring.datasource.max-wait=10000 32 | spring.datasource.min-idle=8 33 | spring.datasource.initial-size=15 34 | spring.datasource.maximum-pool-size=50 35 | spring.datasource.auto-commit=true 36 | spring.datasource.pool-name=MySqlHikariCP 37 | spring.datasource.max-lifetime=1800000 38 | spring.datasource.connection-timeout=30000 39 | spring.datasource.test-on-borrow=true 40 | spring.datasource.validation-query=SELECT 1 FROM DUAL 41 | spring.datasource.connection-test-query=SELECT 1 FROM DUAL 42 | spring.datasource.test-while-idle=true 43 | spring.datasource.remove-abandoned=true 44 | spring.datasource.remove-abandoned-timeout=180 45 | spring.datasource.min-evictable-idle-time-millis=1800000 46 | spring.datasource.time-between-eviction-runs-millis=300000 47 | 48 | 49 | #mybatis-plus 50 | mybatis-plus.mapper-locations=classpath:com/mapper/xml/*.xml 51 | mybatis-plus.type-aliases-package=com.drug.entity 52 | mybatis-plus.configuration.map-underscore-to-camel-case=true 53 | mybatis-plus.global-config.db-config.update-strategy= ignored 54 | mybatis-plus.global-config.db-config.insert-strategy= ignored 55 | 56 | # JACKSON (JacksonProperties) 57 | spring.jackson.date-format=yyyy-MM-dd HH:mm:ss 58 | spring.mvc.format.date=yyyy-MM-dd HH:mm:ss 59 | #spring.jackson.joda-date-time-format=yyyy-MM-dd HH:mm:ss 60 | 61 | # Time zone used when formatting dates. For instance, "Asia/Shanghai" or "GMT+10". 62 | spring.jackson.time-zone=Asia/Shanghai 63 | 64 | nacos.config.server-addr=127.0.0.1:8848 65 | nacos.discovery.server-addr=127.0.0.1:8848 -------------------------------------------------------------------------------- /picture/picture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture1.png -------------------------------------------------------------------------------- /picture/picture10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture10.png -------------------------------------------------------------------------------- /picture/picture11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture11.png -------------------------------------------------------------------------------- /picture/picture12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture12.png -------------------------------------------------------------------------------- /picture/picture13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture13.png -------------------------------------------------------------------------------- /picture/picture14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture14.png -------------------------------------------------------------------------------- /picture/picture15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture15.png -------------------------------------------------------------------------------- /picture/picture16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture16.png -------------------------------------------------------------------------------- /picture/picture17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture17.png -------------------------------------------------------------------------------- /picture/picture18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture18.png -------------------------------------------------------------------------------- /picture/picture19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture19.png -------------------------------------------------------------------------------- /picture/picture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture2.png -------------------------------------------------------------------------------- /picture/picture20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture20.png -------------------------------------------------------------------------------- /picture/picture21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture21.png -------------------------------------------------------------------------------- /picture/picture22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture22.png -------------------------------------------------------------------------------- /picture/picture23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture23.png -------------------------------------------------------------------------------- /picture/picture3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture3.png -------------------------------------------------------------------------------- /picture/picture4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture4.png -------------------------------------------------------------------------------- /picture/picture5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture5.png -------------------------------------------------------------------------------- /picture/picture6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture6.png -------------------------------------------------------------------------------- /picture/picture7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture7.png -------------------------------------------------------------------------------- /picture/picture8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture8.png -------------------------------------------------------------------------------- /picture/picture9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/picture/picture9.png --------------------------------------------------------------------------------