基于SSM开发的医药管理系统
10024基于SSM开发的医药管理系统
代码
鏈-椄:https://pan@baidu@com/s/15nP0ATdA3ydksSxlNA2YNQ (把@换成 . 就可正常访问)
趧-紶-碼:6346
f/u枝此段-吶傛打开baidu網盤手机App,caozuo更方便哦
技术
Spring + SpringMVC + Mybatis
工具
eclipse + tomact + mysql + jdk
功能详情
功能详情 |
---|
用户管理 |
药品管理 |
类别管理 |
销售管理 |
进货管理 |
系统管理 |
当前日期 |
系统相关截图
● 系统首页
@RestController
@RequestMapping("/user")
之后
public class UserController {
@GetMapping("/list")
public JSONObject listUser(HttpServletRequest request) {
return userService.listUser(CommonUtil.request2Json(request));
}
}/**
@author: hxy
@description: 用户/角色/权限相关controller
@date: 2017/11/2 10:19
*/
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;/**
- 查询用户列表
- @param request
- @return
*/
@RequiresPermissions(“user:list”)
@GetMapping("/list")
public JSONObject listUser(HttpServletRequest request) {
return userService.listUser(CommonUtil.request2Json(request));
}
@RequiresPermissions(“user:add”)
@PostMapping("/addUser")
public JSONObject addUser(@RequestBody JSONObject requestJson) {
CommonUtil.hasAllRequired(requestJson, “username, password, nickname, roleId”);
return userService.addUser(requestJson);
}@RequiresPermissions(“user:update”)
@PostMapping("/updateUser")
public JSONObject updateUser(@RequestBody JSONObject requestJson) {
CommonUtil.hasAllRequired(requestJson, " nickname, roleId, deleteStatus, userId");
return userService.updateUser(requestJson);
}@RequiresPermissions(value = {“user:add”, “user:update”}, logical = Logical.OR)
@GetMapping("/getAllRoles")
public JSONObject getAllRoles() {
return userService.getAllRoles();
}/**
- 角色列表
- @return
*/
@RequiresPermissions(“role:list”)
@GetMapping("/listRole")
public JSONObject listRole() {
return userService.listRole();
}
/**
- 查询所有权限, 给角色分配权限时调用
- @return
*/
@RequiresPermissions(“role:list”)
@GetMapping("/listAllPermission")
public JSONObject listAllPermission() {
return userService.listAllPermission();
}
/**
- 新增角色
- @return
*/
@RequiresPermissions(“role:add”)
@PostMapping("/addRole")
public JSONObject addRole(@RequestBody JSONObject requestJson) {
CommonUtil.hasAllRequired(requestJson, “roleName,permissions”);
return userService.addRole(requestJson);
}
/**
- 修改角色
- @return
*/
@RequiresPermissions(“role:update”)
@PostMapping("/updateRole")
public JSONObject updateRole(@RequestBody JSONObject requestJson) {
CommonUtil.hasAllRequired(requestJson, “roleId,roleName,permissions”);
return userService.updateRole(requestJson);
}
……
}
package com;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class BlogStarter {
public static void main(String[] args) {
SpringApplication.run(BlogStarter.class, args);
}
}
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
org.example
Spike
1.0-SNAPSHOT
Spike
http://www.example.com
org.springframework.boot
spring-boot-starter-parent
2.0.5.RELEASE
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target>
org.springframework.boot
spring-boot-starter-web
junit
junit
4.11
test
maven-clean-plugin
3.1.0
maven-resources-plugin
3.0.2
maven-compiler-plugin
3.8.0
maven-surefire-plugin
2.22.1
maven-jar-plugin
3.0.2
maven-install-plugin
2.5.2
maven-deploy-plugin
2.8.2
maven-site-plugin
3.7.1
maven-project-info-reports-plugin
3.0.0
package org.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//SpringBoot会帮我们启动tomcat,并加载默认配置
@EnableAutoConfiguration
//SpringMVC相关配置
@RestController
public class App {
@RequestMapping("/")
public String home(){
//网页中输出
return “Hello World!”;
}
public static void main( String[] args ){
//控制台输出
System.out.println( “Hello World!” );
SpringApplication.run(App.class,args);
}
}<?xml version="1.0" encoding="UTF-8"?>
2
3 <project xmlns=“http://maven.apache.org/POM/4.0.0” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
4 xsi:schemaLocation=“http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”>
5 4.0.0
6
7 org.example
8 Spike
9 1.0-SNAPSHOT
10
11 Spike
12
13 http://www.example.com
14
15
16 org.springframework.boot
17 spring-boot-starter-parent
18 2.0.5.RELEASE
19
20
21
22 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23 <maven.compiler.source>1.8</maven.compiler.source>
24 <maven.compiler.target>1.8</maven.compiler.target>
25
26
27
28
29 org.springframework.boot
30 spring-boot-starter-web
31
32
33 mysql
34 mysql-connector-java
35 5.1.6
36
37
38 com.alibaba
39 druid
40 1.1.3
41
42
43 org.mybatis.spring.boot
44 mybatis-spring-boot-starter
45 1.3.1
46
47
48 junit
49 junit
50 4.11
51 test
52
53
54 org.mybatis.generator
55 mybatis-generator-core
56 1.3.5
57
58
59
60
61
62
63
64
65 maven-clean-plugin
66 3.1.0
67
68
69
70 maven-resources-plugin
71 3.0.2
72
73
74 maven-compiler-plugin
75 3.8.0
76
77
78 maven-surefire-plugin
79 2.22.1
80
81
82 maven-jar-plugin
83 3.0.2
84
85
86 maven-install-plugin
87 2.5.2
88
89
90 maven-deploy-plugin
91 2.8.2
92
93
94
95
96 maven-site-plugin
97 3.7.1
98
99
100 maven-project-info-reports-plugin
101 3.0.0
102
103
104
105 org.mybatis.generator
106 mybatis-generator-maven-plugin
107 1.3.5
108
109
110 org.mybatis.generator
111 mybatis-generator-core
112 1.3.5
113
114
115 mysql
116 mysql-connector-java
117 5.1.6
118
119
120
121
122 mybatis generator
123 package
124
125 generate
126
127
128
129
130
131 true
132
133 true
134
135
136 src/main/resource/mybatis-generator.xml
137
138
139
140
141
142
143
144 package org.example;
import org.example.dao.UserDoMapper;
import org.example.dataobject.UserDo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//SpringBoot会帮我们启动tomcat,并加载默认配置
@SpringBootApplication(scanBasePackages = {“org.example”})
//SpringMVC相关配置
@RestController
@MapperScan(“org.example.dao”)
public class App {
@Autowired
private UserDoMapper userDoMapper;
@RequestMapping("/")
public String home(){
UserDo userDo = userDoMapper.selectByPrimaryKey(1);
if(userDo == null){
return “用户对象不存在”;
}else{
return userDo.getName();
}
}
public static void main( String[] args ){
//控制台输出
System.out.println( “Hello World!” );
SpringApplication.run(App.class,args);
}
}
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserDoMapper userDoMapper;
@Autowired
private UserPasswordDOMapper userPasswordDOMapper;
@Override
public UserModel getUserById(Integer id) {
UserDo userDo = userDoMapper.selectByPrimaryKey(id);
if(userDo == null){
return null;
}
//通过用户id获取对应的用户加密密码信息
UserPasswordDO userPasswordDO = userPasswordDOMapper.selectByUserId(userDo.getId());
return convertFromDataObject(userDo,userPasswordDO);
}
public UserModel convertFromDataObject(UserDo userDo, UserPasswordDO userPasswordDO) {
if(userDo == null){
return null;
}
UserModel userModel = new UserModel();
BeanUtils.copyProperties(userDo,userModel);
if(userPasswordDO != null){
userModel.setEncriptPassword(userPasswordDO.getEncriptPassword());
}
return userModel;
}
}@Controller(“user”)
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("/get")
@ResponseBody
public UserVO getUser(@RequestParam(name=“id”) Integer id) {
//调用service服务获取对应id的用户对象并返回给前端
UserModel userModel = userService.getUserById(id);
//将核心领域模型对象转化为可供UI使用的viewobject
return convertFromModel(userModel);
}
private UserVO convertFromModel(UserModel userModel){
if(userModel == null){
return null;
}
UserVO userVO = new UserVO();
BeanUtils.copyProperties(userModel,userVO);
return userVO;
}
}package org.example.response;
public class CommonReturnType {
//表名对应请求的返回处理结果,success/fail
private String status;
//若status返回success,则data内返回前端需要的json数据
//若status返回success,则data内使用通用的错误码格式
private Object data;
//定义一个通用的创建方法
public static CommonReturnType create(Object result){
return CommonReturnType.create(result,“success”);
}
public static CommonReturnType create(Object result,String status){
CommonReturnType type = new CommonReturnType();
type.setStatus(status);
type.setData(result);
return type;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
基于SSM开发的医药管理系统相关推荐
- javaweb基于SSM开发学生请假管理系统 课程设计 毕业设计源码
基于SSM开发学生请假管理系统(大作业/毕业设计) 开发环境: Windows操作系统 开发工具: MyEclipse(eclipse/idea)+Jdk+Tomcat+Mysql数据库 Java E ...
- 基于SSM开发超市会员管理系统
基于SSM开发超市会员管理系统+论文+PPT+开题报告+任务书+外文翻译(大作业/毕业设计) 开发环境: Windows操作系统 开发工具:Myeclipse+Jdk+Tomcat+MySQL数据库 ...
- 基于SSM开发的健身俱乐部管理系统 JAVA MySQL
10105基于SSM开发的健身俱乐部管理系统 技术 Spring + SpringMVC + Mybatis 工具 eclipse + tomact + mysql + jdk 功能详情 管理员权限 ...
- 基于SSM开发的垃圾分类管理系统 JAVA MySQL
10109基于SSM开发的垃圾分类管理系统 代码: 鏈-椄:https://pan@baidu@com/s/1wAjL3PK78Bv9866q-B6kuw (把@换成 . 就可正常访问) 趧-紶-碼: ...
- 新闻管理系统源码java_基于SSM开发的新闻管理系统 附带文档 源码下载
功能概述 后端springMVC. MyBatis框架.前端使用bootstrap.angularJs ,前后端交互为纯Ajax(angularJs) + ui-router,编辑器为百度UEdito ...
- javaweb基于SSM开发个人记账管理系统 课程设计 大作业源码
基于SSM开发个人记账管理系统(大作业) 开发工具:Eclipse(myeclipse/idea)+Jdk+Tomcat+MySQL数据库 演示视频: 基于SSM开发个人记账管理系统 基于SSM开发个 ...
- 基于SSM开发个人财务管理系统
基于SSM+easyUI开发个人财务管理(报表饼状图和折线图)(大作业/毕业设计) 开发环境: Windows操作系统 开发工具:Myeclipse+Jdk+Tomcat+MYSQL数据库 运行效果图 ...
- 基于SSM开发医药销售管理系统
基于SSM开发医药销售管理系统:(毕业设计/课程设计) 开发环境: Windows操作系统 开发工具: MyEclipse(Eclipse)+Jdk+Tomcat+MYSQL数据库 运行效果图: 基于 ...
- javaweb基于SSM开发房屋租赁管理系统(房东 租客两种用户) 课程设计 大作业源码 毕业设计
基于SSM开发房屋租赁管理系统(房东 租客两种用户)(大作业/毕业设计) 开发工具:Eclipse+Jdk+Tomcat+MySQL数据库 演示视频: 基于SSM开发房屋租赁管理系统(房东 租客两种用 ...
最新文章
- R语言构建xgboost模型:自定义损失函数(目标函数、loss function、object function)、评估函数(evaluation function)
- linux的make提示错误46,Linux 2.6.21编译发生错误
- html怎么让五张照片并排显示,最考验右脑5张照片,30s内能发现问题都是牛人,PS做不出来...
- matlab x为整数,关于matlab中用什么字符表示任意整数
- 为什么一个程序中变量只能定义一次_什么是闭包?为什么叫闭包?
- linux重启网络服务后什么端口都不通,linux的端口不通怎么解决
- 清除逻辑库内的所有数据集
- 链表、数组、跳表时间复杂度
- 事后诸葛亮-团队总结
- JS实现全屏和退出全屏
- qcustomplot x轴当前时间_Qt使用QCustomPlot开发
- 利用log4j写日志
- 解决C Runtime R6034的错误
- 与爱同行,育润走进贫困家庭,助推公益事业
- AI互动课正当时,即构AI课堂2.0助推在线教育创新升级
- Verilog:【4】脉冲发生器(pulse_gen.sv)
- 使用域名访问远程jupyter_如何设置远程访问的Jupyter Notebook服务器-01(之预备知识:什么是端口号?)...
- 用IMU监测力量训练中的杠铃速度,帮助科学界和体育界评估杠杆运动学
- Win7高级应用技巧
- 关于Flutter的渠道(channels):master、dev和beta