基于javaweb的SSM医院住院信息管理系统(java+ssm+maven+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

001023031103

011023031103

021023031103

581023021103

591023021103

基于javaweb的SSM医院住院信息管理系统(java+ssm+maven+jsp+mysql)

一、项目简述

本系统功能包括:实现了挂号收费,门诊管理,划价收 费,药房取药,体检管理,药房管理,系统维护等各个模块功能,非常不错。

二、项目运行

环境配置: Jdk1.8 + Tomcat8.5 + Mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: JSP ++ MyBatis + Bootstrap+ Css + JavaScript + JQuery + Ajax + Maven等等。

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
		List<String> wardTypeName = new ArrayList<String>();
wardTypeName = list.stream().map(Category::getName).collect(Collectors.toList());
// System.out.println("列表_病房类型名称:"+wardTypeName);
// 列表转字符串
String wardTypeName_String = String.join("", wardTypeName);
// System.out.println("字符串_病房类型名称:"+wardTypeName_String);
Parameter parameter = new Parameter();
parameter.setCode("004");
parameter.setValue(BaseUtils.toInteger(wardNo));
parameter.setName(wardTypeName_String);
commonService.parameterCodeInsert(parameter);
log.info("病房信息写入参数化表");
JSON json = JSONSerializer.toJSON(new JsonResult<Ward>(ward));
return json.toString();
}

@RequestMapping(value = "/wardStatistics.do", produces = "application/json;charset=utf-8")
@ResponseBody
public String wardStatistics(@Param("departmentNo") Integer departmentNo) {
List<Map<String, Object>> list = wardService.wardStatistics(departmentNo);
JSON json = JSONSerializer.toJSON(new JsonResult<List<Map<String, Object>>>(list));
return json.toString();
}
}
package com.qut.util;


/*验证码模块*/
public class CheckCodeGen implements Serializable {
private static final long serialVersionUID = 1L;
public static final String RANDOMCODEKEY = "_CHECK_CODE";// 放到session中的key
private Random random = new Random();
private String randString = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnprstuvwxy";// 随机产生的字符串

private int width = 70;// 图片
private int height = 24;// 图片
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


public class BaseUtils {
/**
* 将字符串转换为date类型
*/
public static Date toDate(String time) throws ParseException {
if (!(time == null || "".equals(time))) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
java.util.Date worktime = (java.util.Date) sdf.parse(time);
java.util.Date utilDate = worktime;
Date sqlDate = new Date(utilDate.getTime());
return sqlDate;
}
return null;
}

/**
* 字符串转换为date类型YYYY-MM-dd HH:mm:ss
*/
public static Timestamp toDates(String time) throws ParseException {
java.util.Date worktime = null;
if (!(time == null || "".equals(time))) {
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH);
sdf.setLenient(false);
worktime = sdf.parse(time);
return new Timestamp(worktime.getTime());
}
return null;
}

/**
* 将字符串转换为Integer,为空时返回null
*/
public static Integer toInteger(String string) {
if (!(string == null || "".equals(string))) {
Integer str = Integer.parseInt(string);
return str;
}
return null;
}

/**
* 将字符串转换为Integer,为空时返回0
*/
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


@Controller
@RequestMapping("/cost")
public class CostController {
@Resource(name = "costService")
private CostService costService;
Logger log = Logger.getLogger(Log4jLogsDetial.class);

@RequestMapping(value = "/costAdd.do", produces = "application/json;charset=utf-8")
@ResponseBody
public String costAdd(@Param("patientId") String patientId, @Param("types") String types,
@Param("account") Float account, @Param("userId") String userId) {
Cost cost = new Cost();
cost.setAccount(account);
cost.setPatientId(patientId);
cost.setType(types);
cost.setUserId(userId);
String id = System.currentTimeMillis() + "";
cost.setId(id);
costService.costAdd(cost);
log.info("患者" + patientId + "预交费" + cost.getAccount() + "元,收款方为" + cost.getUserId());
JSON json = JSONSerializer.toJSON(new JsonResult<Cost>(cost));
return json.toString();
}

@RequestMapping(value = "/costQuery.do", produces = "application/json;charset=utf-8")
@ResponseBody
public String costQuery(@Param("id") String id, @Param("patientId") String patientId, @Param("types") String types,
@Param("userId") String userId, @Param("startTime") String startTime, @Param("endTime") String endTime,
@Param("patientName") String patientName) throws ParseException {
Map<String, Object> map = new HashMap<String, Object>();
map.put("patientId", BaseUtils.toString(patientId));
map.put("startTime", BaseUtils.toDate(startTime));
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
52
53
	return json.toString();
}

@RequestMapping(value = "/patientLeave.do", produces = "application/json;charset=utf-8")
@ResponseBody
public String patientLeave(String patientId, Integer bedNo, Integer roomNo) {
// 标记patient表中的leaveState状态为1,标记为出院
patientService.patientLeave(patientId);
log.info("患者" + patientId + "出院");
// 改变原床位的状态为可住
Bed bed = new Bed();
bed.setWardNo(roomNo);
bed.setBedNo(bedNo);
bed.setState(0);
bedService.bedUpdate(bed);// 将bed表中的roomNum&&bedNo行的State标记为0,床位设置为未使用
log.info("患者" + patientId + "出院:更新床位状态");
// 判断原病房是否已满
Ward ward = wardService.wardQueryById(roomNo);
if (ward.getState() == 1) {// 如果之前已经住满了,则把新状态置为未住满,state=0
ward.setState(0);
wardService.wardUpdate(ward);
log.info("患者" + patientId + "出院:更新病房状态");
}

JSON json = JSONSerializer.toJSON(new JsonResult<Patient>(new Patient()));
return json.toString();
}

@RequestMapping(value = "/jiesuan.do", produces = "application/json;charset=utf-8")
@ResponseBody
public String jiesuan(String patientId) {
patientService.jiesuan(patientId);
log.info("患者" + patientId + "结算");
JSON json = JSONSerializer.toJSON(new JsonResult<Patient>(new Patient()));
return json.toString();
}

@RequestMapping(value = "/leftFind.do", produces = "application/json;charset=utf-8")
@ResponseBody // 出院记录查询
public String leftFind(String patientId, String patientName, String inStart, String inEnd, String outStart,
String outEnd) throws ParseException {
PatientCode patientCode = new PatientCode();
patientCode.setPatientId(BaseUtils.toString(patientId));
patientCode.setName(BaseUtils.toString(patientName));
patientCode.setStart(BaseUtils.toDate(inStart));
patientCode.setEnd(BaseUtils.toDate(inEnd));
patientCode.setOutStart(BaseUtils.toDate(outStart));
patientCode.setOutEnd(BaseUtils.toDate(outEnd));
patientCode.setOutStatus(1);
List<Map<String, Object>> list = patientService.patientQuery(patientCode);
log.info("患者查询");
for (Map<String, Object> map : list) {
String leaveTime = map.get("leaveTime").toString();
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
			// System.out.println("进入0区");
doctorCode.setState(0);
log.info("设置医生状态为在职");
}
if (state == 1) {
// System.out.println("进入1区");
doctorCode.setState(1);
log.info("设置医生状态为离职");
}
}
if (state == null) {
doctorCode.setState(0);
// System.out.println("进入null区");
}
// System.out.println("医生状态最终设置为" + doctorCode.getState());
if (!(startTime == null || "".equals(startTime))) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date start = (Date) sdf.parse(startTime);
doctorCode.setStartTime(start);
}
if (!(endTime == null || "".equals(endTime))) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date end = (Date) sdf.parse(endTime);
doctorCode.setEndTime(end);
}
List<Doctor> list = doctorService.doctorQuery(doctorCode);
log.info("查询在职医生");
JsonConfig jc = new JsonConfig();
jc.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor("yyyy-MM-dd"));
json = JSONSerializer.toJSON(new JsonResult<List<Doctor>>(list), jc);
return json.toString();

}

@RequestMapping(value = "/doctorDelete.do", produces = "application/json;charset=utf-8")
@ResponseBody
public String doctorDelete(@Param("id") Integer id) {
if (id == 0) {
json = JSONSerializer.toJSON(new JsonResult<Doctor>(3, "该医生不存在", null));
} else {
/**
* 检查该医生名下是否有未出院的患者
*/
PatientCode patientCode = new PatientCode();


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