基于javaweb的SSM医院分诊管理系统(java+ssm+jsp+javascript+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

280023562402

290023562402

300023562402

310023562402

320023562402

330023562402

基于javaweb的SSM医院分诊管理系统(java+ssm+jsp+javascript+mysql)

项目介绍

管理员角色包含以下功能: 管理员登录,用户管理,患者管理,挂号管理,科室管理,分诊叫号管理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33




/**
* 用户controller
*/
@Controller
@RequestMapping("buss/patient")
public class PatientController extends BaseController {

@Autowired
private PatientService patientService;


/**
* 默认页面
*/
@RequestMapping(method = RequestMethod.GET)
public String list() {
return "buss/patientList";
}

/**
* 获取json
*/
@RequiresPermissions("buss:patient:view")
@RequestMapping(value="json",method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> getData(HttpServletRequest request) {
Page<Patient> page = getPage(request);
List<PropertyFilter> filters = PropertyFilter.buildFromHttpRequest(request);
page = patientService.search(page, filters);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public static boolean checkIfNoneMatchEtag(HttpServletRequest request, HttpServletResponse response, String etag) {
String headerValue = request.getHeader("If-None-Match");
if (headerValue != null) {
boolean conditionSatisfied = false;
if (!"*".equals(headerValue)) {
StringTokenizer commaTokenizer = new StringTokenizer(headerValue, ",");

while (!conditionSatisfied && commaTokenizer.hasMoreTokens()) {
String currentToken = commaTokenizer.nextToken();
if (currentToken.trim().equals(etag)) {
conditionSatisfied = true;
}
}
} else {
conditionSatisfied = true;
}

if (conditionSatisfied) {
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader("ETag", etag);
return false;
}
}
return true;
}

/**
* 设置让浏览器弹出下载对话框的Header.
*
* @param fileName 下载后的文件名.
*/
public static void setFileDownloadHeader(HttpServletResponse response, String fileName) {
try {
//中文文件名支持
String encodedfileName = new String(fileName.getBytes(), "ISO8859-1");
response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedfileName + "\"");
} catch (UnsupportedEncodingException e) {
}
}

/**
* 取得带相同前缀的Request Parameters.
*
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
			pageSize=Integer.valueOf(request.getParameter("rows"));
if(StringUtils.isNotEmpty(request.getParameter("sort")))
orderBy=request.getParameter("sort").toString();
if(StringUtils.isNotEmpty(request.getParameter("order")))
order=request.getParameter("order").toString();
return new Page<T>(pageNo, pageSize, orderBy, order);
}

/**
* 获取easyui分页数据
* @param page
* @return map对象
*/
public <T> Map<String, Object> getEasyUIData(Page<T> page){
Map<String, Object> map = new HashMap<String, Object>();
map.put("rows", page.getResult());
map.put("total", page.getTotalCount());
return map;
}

}





/**
* session监听器
*/
@WebListener
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
}

/**
* 获取角色拥有的权限ID集合
* @param id
* @return
*/
@RequiresPermissions("sys:role:permView")
@RequestMapping("{id}/json")
@ResponseBody
public List<Integer> getRolePermissions(@PathVariable("id") Integer id){
List<Integer> permissionIdList=rolePermissionService.getPermissionIds(id);
return permissionIdList;
}

/**
* 修改角色权限
* @param id
* @param newRoleList
* @return
*/
@RequiresPermissions("sys:role:permUpd")
@RequestMapping(value = "{id}/updatePermission")
@ResponseBody
public String updateRolePermission(@PathVariable("id") Integer id,@RequestBody List<Integer> newRoleIdList,HttpSession session){
List<Integer> oldRoleIdList=rolePermissionService.getPermissionIds(id);

//获取application中的sessions
@SuppressWarnings("rawtypes")
HashSet sessions=(HashSet) session.getServletContext().getAttribute("sessions");
@SuppressWarnings("unchecked")
Iterator<Session> iterator= sessions.iterator();
PrincipalCollection pc=null;
//遍历sessions
while(iterator.hasNext()){
HttpSession s=(HttpSession) iterator.next();
User user=(User) s.getAttribute("user");
if(user !=null && user.getId()==id){
pc= (PrincipalCollection) s.getAttribute(String.valueOf(id));
//清空该用户权限缓存
rolePermissionService.clearUserPermCache(pc);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public List<Dept>  allDept(){
List<Dept> deptList=deptService.getAll();
return deptList;
}

/**
* 获取科室json
*/
@RequiresPermissions("buss:dept:view")
@RequestMapping(value="json",method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> getData(HttpServletRequest request) {
Page<Dept> page = getPage(request);
List<PropertyFilter> filters = PropertyFilter.buildFromHttpRequest(request);
page = deptService.search(page, filters);
return getEasyUIData(page);
}

/**
* 添加科室跳转
*
* @param model
*/
@RequiresPermissions("buss:dept:add")
@RequestMapping(value = "create", method = RequestMethod.GET)
public String createForm(Model model) {
model.addAttribute("dept", new Dept());
model.addAttribute("action", "create");
return "buss/deptForm";
}

/**
* 添加科室
*
* @param dept
* @param model
*/
@RequiresPermissions("buss:dept:add")
@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody
public String create(@Valid Dept dept, Model model) {
deptService.save(dept);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
		page.setOrderBy("urgent,createTime");
page.setOrder("desc,asc");
List<PropertyFilter> filters = PropertyFilter.buildFromHttpRequest(request);
page = triageService.search(page, filters);
return getEasyUIData(page);
}

// /**
// * 添加分诊跳转
// *
// * @param model
// */
// @RequiresPermissions("buss:triage:add")
// @RequestMapping(value = "create", method = RequestMethod.GET)
// public String createForm(Model model) {
// model.addAttribute("triage", new Dept());
// model.addAttribute("action", "create");
// return "buss/deptForm";
// }

/**
* 添加分诊
*
* @param triage
* @param model
*/
@RequiresPermissions("buss:triage:add")
@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody
public String create(@Valid Triage triage,Integer patientId,Integer deptId, Model model) {
triage.setStatus("1");
Patient patient = new Patient(patientId);
Dept dept = new Dept(deptId);
triage.setDept(dept);
triage.setPatient(patient);
triage.setCreateTime(new Date());
triageService.save(triage);
return "success";
}

/**
* 叫号
*
* @param model
*/
@RequestMapping(value = "callPatient", method = RequestMethod.GET)
@ResponseBody
public String callPatient(HttpServletRequest request,Model model) {
Page<Triage> page = getPage(request);
page.setOrderBy("urgent,createTime");
page.setOrder("desc,asc");


项目链接:
https://javayms.github.io?id=161122572008200ta
https://javayms.pages.dev?id=161122572008200ta