10096基于JSP开发的医院住院管理系统
运行视频、代码等:
链接:https://pan.baidu.com/s/1g1mo95iv6vFELMHI95OELA
提取码:1589
复制这段内容后打开百度网盘手机App,操作更方便哦
技术
JAVA + JSP
工具
eclipse + tomact + mysql + jdk
功能详情
功能详情 |
---|
医生信息管理 |
病床信息管理 |
病人信息管理 |
收费信息管理 |
统计分析 |
系统管理 |
系统相关截图
● 系统首页
package servlet;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import dao.SimpleWordSegment;
import dao.WordSegment;
import org.apache.log4j.Logger;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
@WebServlet(name = “WordSegmentServlet”, value = “/WordSegmentServlet”)
public class WordSegmentServlet extends HttpServlet {
private static Logger logger = Logger.getLogger(WordSegmentServlet.class);
private WordSegment wordSegment = new SimpleWordSegment();
private JsonObject json = new JsonObject();
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, IOException {
response.setCharacterEncoding(“utf-8”);
response.setContentType(“application/json”);
response.setHeader(“Access-Control-Allow-Origin”, “*”);
String returnType = “JSON”;
String string = request.getParameter(“text”);
switch (returnType) {
case “JSON”:
// 分词结果转换成JSON数据
segment2Json(string);
logger.debug(“要返回的JSON数据为:” + json.toString());
response.getWriter().write(json.toString());
break;
case “JSP”:
break;
default:
break;
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, IOException {
logger.debug(“使用do get方法”);
doPost(request, response);
}
/**
分词算法
@param text
*/
public void segment2Json(String text) {
String[] methods = {“MM”, “RMM”, “BM”, “MC”};
if (text == null || text.equals("")) {
json.addProperty(“status”, false);
json.addProperty(“error”, “分词字符串为空!”);
return ;
}
JsonArray array = new JsonArray();
for (String method : methods) {
JsonObject result = new JsonObject();
// 算法的名称
result.addProperty(“name”, method);
long start = System.currentTimeMillis();
List data = string2dataSegment(method, text);
long end = System.currentTimeMillis();
JsonArray dataSegment = new JsonArray();
if (data != null && data.size() != 0) {
StringBuffer log = new StringBuffer("");
for (String s : data) {
log.append(s + " / ");
dataSegment.add(new JsonPrimitive(s));
}
logger.debug(“分词结果为:” + log);
}
// 算法的分词结果
result.add(“dataSegment”, dataSegment);
// 算法的运行时间
result.addProperty(“time”, end - start);
array.add(result);
1
}
json.addProperty(“status”, true);
// 所有算法的分词结果
json.add(“result”, array);
}
/**
得到对应的分词方法的结果
@param method
@param text
@return
*/
public List string2dataSegment(String method, String text) {
List dataSegment = null;
try {
Method[] methods = wordSegment.getClass().getDeclaredMethods();
for (Method m : methods) {
if (m.getName().equals(method)) {
dataSegment = (List) m.invoke(wordSegment, text);
break;
}
}
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return dataSegment;
}
public JsonObject getJson() {
return json;
}
}
package weibo4j;
import java.util.List;
import weibo4j.model.Favorites;
import weibo4j.model.FavoritesTag;
import weibo4j.model.Paging;
import weibo4j.model.PostParameter;
import weibo4j.model.Tag;
import weibo4j.model.WeiboException;
import weibo4j.org.json.JSONException;
import weibo4j.org.json.JSONObject;
import weibo4j.util.WeiboConfig;
public class Favorite extends Weibo{
/**
*
*/
private static final long serialVersionUID = 2298934944028795652L;
/**
获取当前登录用户的收藏列表
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public List getFavorites() throws WeiboException {
return Favorites.constructFavorites(client.get(WeiboConfig
.getValue(“baseURL”) + “favorites.json”));
}
/*
获取当前登录用户的收藏列表
@param page
、count
1
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public List getFavorites(Paging page) throws WeiboException {
return Favorites.constructFavorites(client.get(
WeiboConfig.getValue(“baseURL”) + “favorites.json”,
null, page));
}
/*
获取当前登录用户的收藏列表ID
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public JSONObject getFavoritesIds() throws WeiboException {
return client.get(WeiboConfig
.getValue(“baseURL”) + “favorites/ids.json”).asJSONObject();
}
/*
获取当前登录用户的收藏列表ID
@return list of the Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites
@since JDK 1.5
/
public JSONObject getFavoritesIds(Paging page) throws WeiboException {
return client.get(WeiboConfig
.getValue(“baseURL”) + “favorites/ids.json”,null,page).asJSONObject();
}
/*
根据收藏ID获取指定的收藏信息
@param id
@return Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites/show
1
@since JDK 1.5
*/
public Favorites showFavorites(String id) throws WeiboException {
return new Favorites(client.get(WeiboConfig.getValue(“baseURL”)
- “favorites/show.json”,
new PostParameter[] { new PostParameter(“id”, id) }));
}
/**
根据标签获取当前登录用户该标签下的收藏列表
@param tid
@return list of the favorite Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites/by_tags
1
@since JDK 1.5
/
public List getFavoritesByTags(String tid) throws WeiboException {
return Favorites.constructFavorites(client.get(
WeiboConfig.getValue(“baseURL”) + “favorites/by_tags.json”,
new PostParameter[] { new PostParameter(“tid”, tid) }));
}
/*
根据标签获取当前登录用户该标签下的收藏列表
@param tid
@param page
@return list of the favorite Status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/show
1
@since JDK 1.5
/
public List getFavoritesByTags(String tid, Paging page)
throws WeiboException {
return Favorites.constructFavorites(client.get(
WeiboConfig.getValue(“baseURL”) + “favorites/by_tags.json”,
new PostParameter[] { new PostParameter(“tid”, tid) }, page));
}
/*
获取当前登录用户的收藏标签列表
@param page
@return list of the favorite tags
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.1
@see favorites/tags
1
@since JDK 1.5
*/
public List getFavoritesTags() throws WeiboException {
return Tag.constructTag(client.get(WeiboConfig
.getValue(“baseURL”) + “favorites/tags.json”));
}
/**
@param 要收藏的微博ID
。
1
@return Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/create
1
@since JDK 1.5
*/
public Favorites createFavorites(String id) throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)
- “favorites/create.json”,
new PostParameter[] { new PostParameter(“id”, id) }));
}
/**
@param 要取消收藏的微博ID
。
1
@return Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/destroy
1
@since JDK 1.5
*/
public Favorites destroyFavorites(String id) throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)
- “favorites/destroy.json”,
new PostParameter[] { new PostParameter(“id”, id) }));
}
/**
批量删除收藏
@param ids
要取消收藏的收藏ID,用半角逗号分隔,最多不超过10个。
1
@return destroy list of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/destroy_batch
1
@since JDK 1.5
*/
public Boolean destroyFavoritesBatch(String ids) throws WeiboException {
try {
return client
.post(WeiboConfig.getValue(“baseURL”)
- “favorites/destroy_batch.json”,
new PostParameter[] { new PostParameter(“ids”, ids) })
.asJSONObject().getBoolean(“result”);
} catch (JSONException e) {
throw new WeiboException(e);
}
}
/**
更新一条收藏的收藏标签
@param id
要需要更新的收藏ID
1
@return update tag of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/update
1
@since JDK 1.5
*/
public Favorites updateFavoritesTags(String id) throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)
- “favorites/tags/update.json”,
new PostParameter[] { new PostParameter(“id”, id) }));
}
/**
更新一条收藏的收藏标签
@param id
要需要更新的收藏ID
1
@param tags
需要更新的标签内容,必须做URLencode,用半角逗号分隔,最多不超过2条。
1
@return update tag of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/update
1
@since JDK 1.5
*/
public Favorites updateFavoritesTags(String id, String tags)
throws WeiboException {
return new Favorites(client.post(WeiboConfig.getValue(“baseURL”)
- “favorites/tags/update.json”, new PostParameter[] {
new PostParameter(“id”, id), new PostParameter(“tags”, tags) }));
}
/**
更新当前登录用户所有收藏下的指定标签
@param id
需要更新的标签ID。
1
@return update tags of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/update_batch
1
@since JDK 1.5
*/
public JSONObject updateFavoritesTagsBatch(String tid, String tag)
throws WeiboException {
return client.post(
WeiboConfig.getValue(“baseURL”)
- “favorites/tags/update_batch.json”,
new PostParameter[] { new PostParameter(“tid”, tid),
new PostParameter(“tag”, tag) }).asJSONObject();
}
/**
删除当前登录用户所有收藏下的指定标签
@param id
需要删除的标签ID。。
1
@return destroy tags of Favorites status
@throws WeiboException
when Weibo service or network is unavailable
1
@version weibo4j-V2 1.0.0
@see favorites/tags/destroy_batch
1
@since JDK 1.5
*/
public Boolean destroyFavoritesTagsBatch(String ids) throws WeiboException {
try {
return client
.post(WeiboConfig.getValue(“baseURL”)
- “favorites/destroy_batch.json”,
new PostParameter[] { new PostParameter(“ids”, ids) })
.asJSONObject().getBoolean(“result”);
} catch (JSONException e) {
throw new WeiboException(e);
}
}