——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明





基于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等等。
——————————CodeStart——————————
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()); String wardTypeName_String = String.join("", wardTypeName); 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"; 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 {
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; }
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; }
public static Integer toInteger(String string) { if (!(string == null || "".equals(string))) { Integer str = Integer.parseInt(string); return str; } return null; }
|
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) { patientService.patientLeave(patientId); log.info("患者" + patientId + "出院"); Bed bed = new Bed(); bed.setWardNo(roomNo); bed.setBedNo(bedNo); bed.setState(0); bedService.bedUpdate(bed); log.info("患者" + patientId + "出院:更新床位状态"); Ward ward = wardService.wardQueryById(roomNo); if (ward.getState() == 1) { 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
| doctorCode.setState(0); log.info("设置医生状态为在职"); } if (state == 1) { doctorCode.setState(1); log.info("设置医生状态为离职"); } } if (state == null) { doctorCode.setState(0); } 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();
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=151023491103200xt
https://javayms.pages.dev?id=151023491103200xt