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





基于javaweb的JSP+Servlet慢病报销管理信息系统(java+mysql+jdbc+servlet+jsp)
一、项目简述 功能: 慢病管理,医疗机构管理,家庭管理,费用交纳,费用报销,报表统计等等功能。
二、项目运行
环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
Jdbc+ Servlert + Jsp + css + JavaScript + JQuery + Ajax + Fileupload等等
——————————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
|
public void updatePolicy(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
int years=Integer.parseInt(req.getParameter("years")); double upperlimit=Double.parseDouble(req.getParameter("upperlimit")); double proportion=Double.parseDouble(req.getParameter("proportion")); Policy policy=new Policy(years,upperlimit,proportion); policy.update(); req.getRequestDispatcher("PolicyServlet?method=policyList").forward(req, resp); } } package www.gxuwz.medical.web.servlet;
@WebServlet("/ChronicdisServlet") public class ChronicdisServlet extends BaseServlet { private static final long serialVersionUID = 1L;
|
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
| Calendar calendar = Calendar.getInstance(); int i = calendar.get(Calendar.YEAR); PolicyDao policyDao = new PolicyDao(); Policy policy = policyDao.queryByYears(i); double upperlimit = policy.getUpperlimit(); double surplus = upperlimit - sum; HashMap<String, Double> hashMap = new HashMap<String, Double>(); hashMap.put("sum", sum); hashMap.put("surplus", surplus); double flag;
if (payamount > surplus) { flag = 0; hashMap.put("flag", flag); resp.getWriter().print(new Gson().toJson(hashMap)); } else { flag = 1; hashMap.put("flag", flag); Chpay chpay = new Chpay(null, rccardnum, payamount, null, null, registrar, null); chpay.add(); resp.getWriter().print(new Gson().toJson(hashMap)); }
}
} package www.gxuwz.medical.web.servlet;
|
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
|
@WebServlet("/ChpayServlet") public class ChpayServlet extends BaseServlet { private static final long serialVersionUID = 1L;
public void chpayList(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String pageNo = req.getParameter("pageNo"); int p = pageNo == null ? 1 : Integer.parseInt(pageNo); ChpayDao chpay = new ChpayDao(); Page chpaypage = chpay.queryAll(p, Constant.ROW); int prePage = chpaypage.prePage(); int lastPage = chpaypage.lastPage(); boolean last = chpaypage.isLast(); List<Integer> linkLumbers = chpaypage.linkLumbers(); List datas = chpaypage.getDatas(); req.setAttribute("chpaypage", chpaypage); req.setAttribute("datas", datas); req.setAttribute("prePage", prePage); req.setAttribute("lastPage", lastPage); req.setAttribute("linkLumbers", linkLumbers); req.setAttribute("last", last);
req.getRequestDispatcher("/page/chpay/chpay_list.jsp").forward(req, resp); }
|
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
| req.setAttribute("selRole", selRoleByRoleid); req.getRequestDispatcher("page/role/role_update.jsp").forward(req, resp); } }
public void updRole(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException{ rd=new RoleDao(); String roleName = req.getParameter("roleName"); String fullName = req.getParameter("fullName"); String roleid = req.getParameter("roleid"); int updRole = rd.updRole(roleName, fullName, roleid); if(updRole>0){ req.getRequestDispatcher("roleData?method=roleManager").forward(req, resp); }else{ } }
public void delRole(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException{ String roleid = req.getParameter("roleid"); rd=new RoleDao(); int delRole = rd.delRole(roleid); if(delRole>0){ req.getRequestDispatcher("roleData?method=roleManager").forward(req, resp);
} } } package www.gxuwz.medical.web.filter;
|
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
| int prePage = page.prePage(); int lastPage = page.lastPage(); boolean last = page.isLast(); List datas = page.getDatas(); List<Integer> linkLumbers = page.linkLumbers(); resp.getWriter().print(new Gson().toJson(datas));
}
public void hasIll(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { String illcode = req.getParameter("illcode"); String idnumber = req.getParameter("idnumber"); ChperDao ch = new ChperDao(); Chper chper = ch.queryByIdnumber(idnumber, null); IllnumDao illd = new IllnumDao(); boolean falg = true; if (chper != null) { falg = illd.query(chper.getRccardnum(), illcode); } else { this.searchName(req, resp); } resp.getWriter().println(new Gson().toJson(falg));
}
public void addIllnum(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String idnumber = req.getParameter("idnumber"); String illcode = req.getParameter("illcode"); String starttime = req.getParameter("starttime"); String endtime = req.getParameter("endtime"); System.out.println("是否接到身份证?"+idnumber); System.out.println("是否接到慢性病?"+illcode); System.out.println("是否接到开始时间?"+starttime); System.out.println("是否接到结束时间?"+endtime); ChperDao ch = new ChperDao(); Illnum i = new Illnum(null, null, idnumber, illcode, starttime, endtime); i.add(); req.getRequestDispatcher("IllnumServlet?method=illnumList").forward(req, resp); }
|
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
|
public class UserLoginServlet extends BaseServlet {
private static final long serialVersionUID = 1L; UserDao ud = new UserDao();
public void userLogin(HttpServletRequest req, HttpServletResponse resp) throws IOException { String userid = req.getParameter("userid"); String pwd = req.getParameter("pwd"); String sql="select * from t_user where userid=? and pwd =?"; User u = ud.userLogin(sql,userid, pwd); HttpSession hs = req.getSession(); if (u != null) { hs.setAttribute("loginSuccess", u); resp.sendRedirect("page/user/main.jsp"); } else { hs.setAttribute("flag", "loginFailed"); resp.sendRedirect("page/user/user_login.jsp"); } }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=461422312105200ix
https://javayms.pages.dev?id=461422312105200ix