技术标签: 面试 java 阿里巴巴 后端 java进阶 学习路线
源码获取:博客首页 “资源” 里下载!
实现基本预约挂号,预留后台管理系统接口,提供医生科室医生查询。
数据库导入:
在mysql 5.7中创建数据库hospitaldb,然后导入并执行hospitaldb.sql文件;
导入项目并修改配置文件
在idea/eclipse中导入项目,注意此为maven项目,导入时请选择maven项目;
导入成功后,修改jdk相关配置,并依次执行 maven clean 与maven install命令;
执行成功后,配置tomcat;
注:tomcat中配置项目路径必须为/ssm_pro
修改数据库配置:
在jdbc.properties中修改数据库配置;
在tomcat中运行项目,运行成功后,在浏览器中访问:http://localhost:8080/ssm_pro/
默认账号:[email protected] 密码:123456
登录成功即可;
/**
* 医生端
*/
@Controller
@RequestMapping("/doctor")
public class DoctorController {
@Autowired
private AdminService adminService;
@Autowired
private DoctorService doctorService;
@Autowired
private SectionService sectionService;
@Autowired
private PatientService patientService;
@Autowired
private MessagesService messagesService;
private Integer size = 8;//每页显示数量
/**
* 修改信息
* @param model
* @return
*/
@RequestMapping("/tiaomessagelist")
public String tiaomessagelist(@RequestBody List<Messages> mlist,Model model) {
System.out.println(mlist.size());
model.addAttribute("mlist",mlist);
return "doctor/messageList";
}
@RequestMapping("/index")
public String index(Model model,HttpServletRequest request) {
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
if(dt == null) {
return "redirect:/login/index";
}
int doctor = doctorService.countByExample(null); //医生总数
int section = sectionService.count(); //科室总数
//患者总数
int patient = 0;
List<Patient> selectByExample = patientService.selectByExample(null);
Messages mess = new Messages();
for (Patient pa : selectByExample) {
if(pa.getName() != null) {
mess.setDid(dt.getId());
mess.setUsername(pa.getName());
List<Messages> selectMessages = messagesService.selectMessages(mess);
if(selectMessages.size() > 0 )
{
patient++;
}
}
}
//预约总数
MessagesExample me = new MessagesExample();
MessagesExample.Criteria mecriteria = me.createCriteria();
mecriteria.andDidEqualTo(dt.getId());
int messages = messagesService.countByExample(me);
model.addAttribute("doctor",doctor);
model.addAttribute("section",section);
model.addAttribute("patient",patient);
model.addAttribute("messages",messages);
PageInfo<Doctor> pageInfo = doctorService.selectDoctorList(null,1,4);
if(pageInfo.getList() != null && pageInfo.getList().size() >0 ) {
List<Doctor> list = pageInfo.getList();
StringBuffer sb = new StringBuffer();
StringBuffer shu = new StringBuffer();
int v = list.size()-1;
for(int i=0;i<list.size();i++) {
if(v==i) {
sb.append(list.get(i).getName());
shu.append(list.get(i).getYipeoples());
}else {
sb.append(list.get(i).getName()+",");
shu.append(list.get(i).getYipeoples()+",");
}
}
model.addAttribute("name",sb.toString());
model.addAttribute("nu",shu.toString());
}
return "doctor/index";
}
/**
* 修改信息
* @param model
* @return
*/
@RequestMapping("/doctorUptatePage")
public String doctorUptatePage(Model model,HttpServletRequest request) {
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
if(dt != null) {
Doctor doctor = doctorService.selectByPrimaryKey(dt.getId());
List<Section> sectionlist2 = null;
model.addAttribute("doctor",doctor);
//科室
Section se = new Section();
se.setType(1);
List<Section> sectionlist = sectionService.selectByExample(se);
model.addAttribute("sectionlist", sectionlist);
//科室详情
Section se1 = sectionService.selectByPrimaryKey(doctor.getSid());
if(se1 != null) {
Section section = new Section();
section.setPid(se1.getPid());
section.setType(2);
sectionlist2 = sectionService.selectByExample(section);
model.addAttribute("sectionlist2", sectionlist2);
model.addAttribute("se1", se1);
}
}
return "doctor/doctorUptate";
}
/**
* 修改医生信息
*/
@RequestMapping("/messageTime")
public String messageTime(String name,Model model,HttpServletRequest request) {
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
if(name != null) {
Messages mess = new Messages();
mess.setDid(dt.getId());
mess.setUsername(name);
List<Messages> selectMessages = messagesService.selectMessagesTWO(mess);
model.addAttribute("messagesList", selectMessages);
}
return "doctor/messageTime";
}
/**
* 修改医生信息
*/
@RequestMapping("/admindoctorUptate")
public String adminUptatePassword(Doctor doctor,Model model) {
if(doctor != null && doctor.getId() != null) {
if(doctor.getSid() != null) {
Section section = sectionService.selectByPrimaryKey(doctor.getSid());
doctor.setSid(section.getId());
doctor.setSname(section.getName());
}
doctorService.updateByPrimaryKeySelective(doctor);
}
return "redirect:/doctor/index";
}
/**
* 预约信息列表
*/
@RequestMapping("/messageList")
public String doctorList(Model model, Messages messages, @RequestParam(value="page",defaultValue="1")Integer page,Integer type,HttpServletRequest request) {
if(messages == null) {
messages = new Messages();
}
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
if(dt != null){
messages.setDid(dt.getId());
}else{
return "redirect:/login/index";
}
messages.setType(type);
//底层数据
PageInfo<Messages> pageInfo = messagesService.selectMessagesList(messages,page,size);
//工作区数据
messages.setTime(new Date());
List<Messages> list = messagesService.selectMessagesPai(messages);
model.addAttribute("mlist",list);
model.addAttribute("messagesList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("messages",messages);
model.addAttribute("type",type);
return "doctor/messageList";
}
/**
*医生列表查询
*/
@RequestMapping(value = "/messageAjax")
@ResponseBody
public List<Messages> doctorList(HttpServletRequest request) {
Messages messages = new Messages();
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
messages.setDid(dt.getId());
messages.setType(1);
messages.setTime(new Date());
PageInfo<Messages> pageInfo2 = messagesService.selectMessagesListDemo(messages,1,99);
return pageInfo2.getList();
}
/**
*医生列表查询
*/
@RequestMapping(value = "/messagesQundingUptate")
@ResponseBody
public String messagesQundingUptate(Integer id) {
if(id != null) {
Messages messages = new Messages();
messages.setId(id);
messages.setType(3); //3表示预约成功
messagesService.updateByPrimaryKeySelective(messages);
Messages selectByPrimaryKey = messagesService.selectByPrimaryKey(id);
Messages mes = new Messages();
mes.setType(1);
mes.setTime(new Date());
mes.setDid(selectByPrimaryKey.getDid());
List<Messages> list = messagesService.selectMessagesPai(mes);
for (int i = 0; i < list.size(); i++) {
list.get(i).setPai(i+1);
messagesService.updateByPrimaryKeySelective(list.get(i));
}
}
return "ok";
}
/**
*患者信息列表
*/
@RequestMapping("/patientList")
public String messageList(Model model, Patient patient, @RequestParam(value="page",defaultValue="1")Integer page,HttpServletRequest request) {
if(patient == null) {
patient = new Patient();
}
HttpSession session = request.getSession();
Doctor dt = (Doctor) session.getAttribute("DOCTOR");
if(dt == null){
return "redirect:/login/index";
}
/*
* PageInfo<Patient> pageInfo =
* patientService.selectPatientList(patient,1,size); List<Patient> list =
* pageInfo.getList(); List<Patient> list2 = new ArrayList<Patient>(); Messages
* messages = new Messages(); boolean pan = false; SimpleDateFormat sdf = new
* SimpleDateFormat("yyyy-MM-dd"); for (Patient pa : list) { if(pa.getPid() !=
* null && pa.getPid() != 0){ messages.setDid(dt.getId());
* messages.setUid(pa.getPid()); messages.setUsername(pa.getName());
* List<Messages> ml = messagesService.selectMessages(messages); if(ml.size() >
* 0 ){ Date time = ml.get(0).getTime(); pa.setUsername(sdf.format(time));
* pa.setPhone(dt.getName()); pa.setIdentitys(dt.getSname()); list2.add(pa); }
*
* } } if(list2.size() <= 8) { pageInfo.setPages(1); }
*/
Messages messages = new Messages();
// messages.setTime(new Date());
messages.setType(1);
messages.setDid(dt.getId());
PageInfo<Messages> pageInfo = messagesService.selectMessagesList(messages, 1, size);
model.addAttribute("doctorList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("patient",patient);
return "doctor/patientList";
}
/**
*预约信息列表
* @throws ParseException
*/
@RequestMapping(value = "/tiaozhuanList")
@ResponseBody
public String messagesList(@RequestParam("xiao")Integer xiao,@RequestParam("da")Integer da) {
Messages message = new Messages();
if(xiao != null & da != null) {
Messages mexiao = messagesService.selectByPrimaryKey(xiao);
Integer px = mexiao.getPai();
Messages meda = messagesService.selectByPrimaryKey(da);
mexiao.setPai(meda.getPai());
meda.setPai(px);
messagesService.updateByPrimaryKeySelective(mexiao);
messagesService.updateByPrimaryKeySelective(meda);
}
return null;
}
/**
* 确定预约
*/
@RequestMapping("/messagesUptate")
public String messagesUptate(Integer id) {
if(id != null) {
Messages messages = new Messages();
messages.setId(id);
messages.setType(3); //3表示预约成功
messagesService.updateByPrimaryKeySelective(messages);
}
return "redirect:/doctor/messageList?type=1";
}
/**
* 取消
*/
@RequestMapping("/messagesQuXiao")
public String me
文章浏览阅读1k次。通过使用ajax方法跨域请求是浏览器所不允许的,浏览器出于安全考虑是禁止的。警告信息如下:不过jQuery对跨域问题也有解决方案,使用jsonp的方式解决,方法如下:$.ajax({ async:false, url: 'http://www.mysite.com/demo.do', // 跨域URL ty..._nginx不停的xhr
文章浏览阅读2k次。关于在 Oracle 中配置 extproc 以访问 ST_Geometry,也就是我们所说的 使用空间SQL 的方法,官方文档链接如下。http://desktop.arcgis.com/zh-cn/arcmap/latest/manage-data/gdbs-in-oracle/configure-oracle-extproc.htm其实简单总结一下,主要就分为以下几个步骤。..._extproc
文章浏览阅读1.5w次。linux下没有上面的两个函数,需要使用函数 mbstowcs和wcstombsmbstowcs将多字节编码转换为宽字节编码wcstombs将宽字节编码转换为多字节编码这两个函数,转换过程中受到系统编码类型的影响,需要通过设置来设定转换前和转换后的编码类型。通过函数setlocale进行系统编码的设置。linux下输入命名locale -a查看系统支持的编码_linux c++ gbk->utf8
文章浏览阅读750次。今天准备从生产库向测试库进行数据导入,结果在imp导入的时候遇到“ IMP-00009:导出文件异常结束” 错误,google一下,发现可能有如下原因导致imp的数据太大,没有写buffer和commit两个数据库字符集不同从低版本exp的dmp文件,向高版本imp导出的dmp文件出错传输dmp文件时,文件损坏解决办法:imp时指定..._imp-00009导出文件异常结束
文章浏览阅读143次。当下是一个大数据的时代,各个行业都离不开数据的支持。因此,网络爬虫就应运而生。网络爬虫当下最为火热的是Python,Python开发爬虫相对简单,而且功能库相当完善,力压众多开发语言。本次教程我们爬取前程无忧的招聘信息来分析Python程序员需要掌握那些编程技术。首先在谷歌浏览器打开前程无忧的首页,按F12打开浏览器的开发者工具。浏览器开发者工具是用于捕捉网站的请求信息,通过分析请求信息可以了解请..._初级python程序员能力要求
文章浏览阅读7.6k次,点赞2次,收藏6次。@Service标注的bean,类名:ABDemoService查看源码后发现,原来是经过一个特殊处理:当类的名字是以两个或以上的大写字母开头的话,bean的名字会与类名保持一致public class AnnotationBeanNameGenerator implements BeanNameGenerator { private static final String C..._@service beanname
文章浏览阅读6.9w次,点赞73次,收藏463次。1.前序创建#include<stdio.h>#include<string.h>#include<stdlib.h>#include<malloc.h>#include<iostream>#include<stack>#include<queue>using namespace std;typed_二叉树的建立
文章浏览阅读7.1k次。在Asp.net上使用Excel导出功能,如果文件名出现中文,便会以乱码视之。 解决方法: fileName = HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8);_asp.net utf8 导出中文字符乱码
文章浏览阅读2.1k次,点赞4次,收藏23次。第一次实验 词法分析实验报告设计思想词法分析的主要任务是根据文法的词汇表以及对应约定的编码进行一定的识别,找出文件中所有的合法的单词,并给出一定的信息作为最后的结果,用于后续语法分析程序的使用;本实验针对 PL/0 语言 的文法、词汇表编写一个词法分析程序,对于每个单词根据词汇表输出: (单词种类, 单词的值) 二元对。词汇表:种别编码单词符号助记符0beginb..._对pl/0作以下修改扩充。增加单词
文章浏览阅读773次。我在使用adb.exe时遇到了麻烦.我想使用与bash相同的adb.exe shell提示符,所以我决定更改默认的bash二进制文件(当然二进制文件是交叉编译的,一切都很完美)更改bash二进制文件遵循以下顺序> adb remount> adb push bash / system / bin /> adb shell> cd / system / bin> chm..._adb shell mv 权限
文章浏览阅读6.8k次,点赞12次,收藏125次。1. 单目相机标定引言相机标定已经研究多年,标定的算法可以分为基于摄影测量的标定和自标定。其中,应用最为广泛的还是张正友标定法。这是一种简单灵活、高鲁棒性、低成本的相机标定算法。仅需要一台相机和一块平面标定板构建相机标定系统,在标定过程中,相机拍摄多个角度下(至少两个角度,推荐10~20个角度)的标定板图像(相机和标定板都可以移动),即可对相机的内外参数进行标定。下面介绍张氏标定法(以下也这么称呼)的原理。原理相机模型和单应矩阵相机标定,就是对相机的内外参数进行计算的过程,从而得到物体到图像的投影_相机-投影仪标定
文章浏览阅读2.2k次。文章目录Wayland 架构Wayland 渲染Wayland的 硬件支持简 述: 翻译一篇关于和 wayland 有关的技术文章, 其英文标题为Wayland Architecture .Wayland 架构若是想要更好的理解 Wayland 架构及其与 X (X11 or X Window System) 结构;一种很好的方法是将事件从输入设备就开始跟踪, 查看期间所有的屏幕上出现的变化。这就是我们现在对 X 的理解。 内核是从一个输入设备中获取一个事件,并通过 evdev 输入_wayland