jdk1.8 + tomcat8.5 + mysql + eclispe(intellij idea,eclispe,myeclispe,sts都支持)
springboot+ springmvc + mybatis + jsp + html+ javascript + jquery + ajax + maven等等
宠物医院与商城一体的系统
后端管理员控制层:
/*** 后端管理员控制层*/@controller@requestmapping("/api")public class patientcontroller {private integer size = 6;//每页显示数量@autowiredprivate adminrvice adminrvice;@autowiredprivate ctionrvice ctionrvice;@autowiredprivate bannersrvice bannersrvice; @autowiredprivate doctorrvice doctorrvice;@autowiredprivate patientrvice patientrvice;@autowiredprivate messagesrvice messagesrvice;/*** 医生列表*/@requestmapping("/doctorlist1")public string doctorlist(model model, doctor doctor, @requestparam(value="page",defaultvalue="1")integer page) {if(doctor == null) {doctor = new doctor();}pageinfo<doctor> pageinfo = doctorrvice.lectdoctorlist(doctor,page,size);list<doctor> list = pageinfo.getlist();model.addattribute("doctorlist",pageinfo.getlist());model.addattribute("pageinfo",pageinfo);model.addattribute("doctor",doctor);return "patient/doctorlist";}/***登录* @throws parexception */@requestmapping(value = "/urlogin")@responbodypublic patient urlogin(@requestbody patient patient) throws parexception {list<patient> list = patientrvice.lectpatient(patient);if(patient != null && patient.geturname() != null && patient.getpassword() != null) {if(list.size() > 0) {return list.get(0);}}return patient;} /***登录* @throws parexception */@requestmapping(value = "/passwordsave")@responbodypublic string passwordsave(@requestbody patient patient ) throws parexception {if(patient != null && 美发造型patient.geturname() != null && patient.getpassword() != null) {patient pa = new patient();pa.turname(patient.geturname());list<patient> list = patientrvice.lectpatient(pa);if(list.size() > 0) {return "err";}patientrvice.inrtlective(patient);return "ok";}return "err";} /***登录验证* @throws parexception */@requestmapping(value = "/urloginview")@responbodypublic string urloginview(httprvletrequest request) throws parexception {httpssion ssion = request.getssion();patient patient =(patient) ssion.getattribute("ur");system.out.println("*********登陆验证********");system.out.println(patient); if(patient != null) {return "ok";}return "err";} /***banner图*/@requestmapping(value = "/bannerlist")@responbodypublic string[] formadd() {banners banners = bannersrvice.lectbyprimarykey(1);string[] split = null;if(banners != null && banners.getimg() != null) {split = banners.getimg().split(",");}return split;}/***科室查询*/@requestmapping(value = "/ctionlist")@responbodypublic map<string,list<ction>> ctionlist() {map<string,list<ction>> map = new hashmap<string,list<ction>>();list<ction> ctionlist2 = null;ction = new ction();.ttype(1);list<ction> ctionlist = ctionrvice.lectbyexample();if(ctionlist.size() > 0 ) {//科室详情ction ction = new ction();ction.tpid(ctionlist.get(0).getid());ction.ttype(2);ctionlist2 = ctionrvice.lectbyexample(ction);}map.put("ctionlist",ctionlist);map.put("ctionlist2",ctionlist2); return map;}/***科室下级查询*/@requestmapping(value = "/ctionxialist")@responbodypublic list<ction> ctionxialist(integer id) {ction = new ction();.tpid(id);.ttype(2);list<ction> ctionlist = ctionrvice.lectbyexample();return ctionlist;}/***科室下级查询*/@requestmapping(value = "/patientpai")@responbodypublic integer patientpai(integer id) {patient pa = new patient();pa.tpid(id);patientexample = new patientexample();patientexample.criteria criteria = .createcriteria();if(pa != null){if(pa.getpid() != null) {criteria.andpidequalto(pa.getpid());}}list<patient> lectbyexample = patientrvice.lectbyexample();if(lectbyexample.size() >0 ) {list<messages> lmlist = messagesrvice.lectbyexample(null);int j = 0 ;for (messages me : lmlist) {if(me.getuid() == id) {return j;}j++;}}return -1;}/***查询科室*/@requestmapping(value = "/ctionamelist")@responbodypublic list<ction> ctionamelist(string name) {ction = new ction();.tname(name);.ttype(2);list<ction> ctionlist = ctionrvice.lectbyexample();if(ctionlist.size() > 0) {//查询全部科室.tname(null);.tpid(ctionlist.get(0).getpid());.ttype(2);ctionlist = ctionrvice.lectbyexample();}return ctionlist;}/*** 坐诊时间yuyue*/@requestmapping("/doctortimepage")public string doctortimepage(integer id,model model) {if(id != null) {doctor doctor = doctorrvice.lectbyprimarykey(id);model.addattribute("doctor",doctor);}return "patient/doctortime";}/***医生列表查询*/@requestmapping(value = "/doctorlist")@responbodypublic list<doctor> doctorlist(integer sid) {doctor doctor = new doctor();doctor.tsid(sid);list<doctor> lectdoctor = doctorrvice.lectdoctor(doctor);return lectdoctor;} /***医生列表查询*/@requestmapping(value = "/doctorlike")@responbodypublic list<doctor> doctorlike(string name) {doctor doctor = new doctor();doctor.tname(name);list<doctor> lectdoctor = doctorrvice.lectdoctor(doctor);return lectdoctor;} /***科室查询*/@requestmapping(value = "/doctoridlist")@responbodypublic ction doctoridlist(integer sid) {ction lectbyprimarykey = ctionrvice.lectbyprimarykey(sid);return lectbyprimarykey;} /***医生列表查询* @throws parexception */@requestmapping(value = "/doctortimelect")@responbodypublic list<doctor> doctortimelect(@requestparam("datetimei")string datetimei,@requestparam("id")integer id) throws parexception {doctor doctor = new doctor();simpledateformat simpledateformat = new simpledateformat("yyyy-mm-dd");doctor.tsid(id);doctor.tbegindate(simpledateformat.par(datetimei));list<doctor> lectdoctor = doctorrvice.lecttime(doctor);return lectdoctor;} /***医生列表查询* @throws parexception */@requestmapping(value = "/doctorgerenlist")@responbodypublic doctor doctorgerenlist(integer id) throws parexception {doctor doctor = doctorrvice.lectbyprimarykey(id);return doctor;} /***时间格式转换*/@requestmapping(value = "/doctoryuyuetime")@responbodypublic map<string,string> doctoryuyuetime(integer id) {map<string,string> map = new hashmap<string,string>();simpledateformat sdf = new simpledateformat("hh:mm"); doctor doctor = doctorrvice.lectbyprimarykey(id);map.put("begin",sdf.format(doctor.getbegintime()));map.put("end",sdf.format(doctor.getendtime())); return map;}/***时间格式转换* @throws parexception */@requestmapping(value = "/timezhuan")@responbodypublic string timezhuan(string time) throws parexception {date par = new date();simpledateformat sdf = new simpledateformat("yyyy-mm-dd"); if(time != null) {par = sdf.par(time);}return sdf.format(par);}/***添加患者信息*/@requestmapping(value = "/loginbypatient")public string loginbypatient(@requestbody patient patient) {return "loginbypatient";}/***添加患者信息*/@requestmapping(value = "/patientsave")public string patientsave(patient patient) {patientrvice.inrtlective(patient);return "loginbypatient";}/*** 判断患者账号*/@requestmapping("/panzhanghao")@responbodypublic map<string,string> panzhanghao(model model, string zhanghao) {map<string, string> map = new hashmap<string, string>();patientexample = new patientexample();patientexample.criteria criteria = .createcriteria();criteria.andurnameequalto(zhanghao);list<patient> lectbyexample = patientrvice.lectbyexample();if(lectbyexample.size() > 0){map.put("pan","err");}el{map.put("pan","ok");}return map;}/*** 患者注册界面*/@requestmapping("/patientaddpage")public string patientaddpage(model model) {return "patientregister";}/***患者信息列表*/@requestmapping(value = "/patientlist")@responbodypublic list<patient> patientlist(integer pid,httprvletrequest request) {patient pa = new patient();pa.tpid(pid);list<patient> lectpatient = patientrvice.lectpatient(pa);return lectpatient;}/***患者信息列表*/@requestmapping("/patientlist2")public string messagelist2(model model, patient patient, @requestparam(value="page",defaultvalue="1")integer page,httprvletrequest request) {if(patient == null) {patient = new patient();}httpssion ssion 销售思路= request.getssion();patient patient1 = (patient) ssion.getattribute("patient");if(patient1 == null){return "redirect:/login/font/index";}/** pageinfo<patient> pageinfo =* patientrvice.lectpatientlist(patient,1,size); list<patient> list =* pageinfo.getlist(); list<patient> list2 = new arraylist<patient>(); messages* messages = new messages(); boolean pan = fal; simpledateformat sdf = new* simpledateformat("yyyy-mm-dd"); for (patient pa : list) { if(pa.getpid() !=* null && pa.getpid() != 0){ messages.tdid(dt.getid());* messages.tuid(pa.getpid()); messages.turname(pa.getname());* list<messages> ml = messagesrvice.lectmessages(messages); if(ml.size() >* 0 ){ date time = ml.get(0).gettime(); pa.turname(sdf.format(time));* pa.tphone(dt.getname()); pa.tidentitys(dt.getsname()); list2.add(pa); }* * } } if(list2.size() <= 8) { pageinfo.tpages(1); }*/messages messages = new messages();// messages.ttime(new date());messages.ttype(1);messages.tuid(patient1.getpid()); pageinfo<messages> pageinfo = messagesrvice.lectmessageslist(messages, 1, size);model.addattribute("doctorlist",pageinfo.getlist());model.addattribute("pageinfo",pageinfo);model.addattribute("patient",patient);return "patient/patientlist";}/***患者信息列表*/@requestmapping(value = "/patiendel")@responbodypublic list<patient> pa旗手介绍tiendel(integer id) {if(id != null) {patientrvice.deletebyprimarykey(id);}list<patient> lectbyexample = patientrvice.lectbyexample(null);return lectbyexample;}/***患者信息查看*/@requestmapping(value = "/patientupatepage")@responbodypublic patient patientupatepage(integer id) {patient patient = null;if(id != null) {patient = patientrvice.lectbyprimarykey(id);}return patient;}/***患者信息修改*/@requestmapping(value = "/patientupdate")@responbodypublic patient patientupdate(@requestbody patient patient) {patientrvice.updatebyprimarykeylective(patient);return null;}/***预约信息* @throws parexception */@requestmapping(value = "/messagessave")public string messagessave(messages patient,httprvletrequest request) throws parexception {httpssion ssion = request.getssion();patient patient1 = (patient) ssion.getattribute("patient");messages hui = null;simpledateformat simpledateformat = new simpledateformat("yyyy-mm-dd");date shijian = simpledateformat.par(patient.getsname());patient.ttime(shijian);patient.ttype(1);//待预约doctor doctor = doctorrvice.lectbyprimarykey(patient.getdid());//医生if(doctor != null) {patient.tdname(doctor.getname());if(doctor.getyipeoples() == null) {doctor.tyipeoples(0);}doctor.tyipeoples(doctor.getyipeoples()+1);doctorrvice.updatebyprimarykeylective(doctor);}ction ction = ctionrvice.lectbyprimarykey(patient.getsid());//科室if(ction != null) {patient.tsname(ction.getname());}patient pa = patientrvice.lectbyprimarykey(patient1.getid()); //患者if(pa != null) {patient.tuid(pa.getpid());patient.turid(pa.getid());patient.tphone(pa.getphone()); patient.turname(pa.geturname());patient.tage(pa.getage());int countbyexample = messagesrvice.countbyexample(null);patient.tbianhao(countbyexample+1);//排序messages message = new messages();// message.tuid(patient.getuid());message.ttime(patient.gettime());message.tdid(patient.getdid());message.ttype(-1);list<messages> list = messagesrvice.lectmessages(message);if(list.size() <= 0) {patient.tpai(1);}el {patient.tpai(list.size()+1);}}messagesrvice.inrtlective(patient);if(patient.getid() != null) {hui= messagesrvice.lectbyprimarykey(patient.getid());messages xin = new messages();xin.tdid(hui.getdid());xin.ttype(1);xin.ttime(shijian);list<messages> lectmessagespai = messagesrvice.lectmessagespai(xin);hui.tage(lectmessagespai.size());}return "redirect:/api/doctorlist1";}/***取消预约* @throws parexception */@requestmapping(value = "/messagesquxiao")public string messagesquxiao(integer id) throws parexception {messages ma = new messages();ma.tid(id);ma.ttype(2); //取消预约messagesrvice.updatebyprimarykeylective(ma);messages mes = messagesrvice.lectbyprimarykey(id);messages messages = new messages();messages.ttype(1);messages.tuid(mes.getuid());messages.ttime(new date());list<messages> list = messagesrvice.lectmessages(messages);return "redirect:/api/patientlist2";}/***预约信息列表* @throws parexception */@requestmapping(value = "/messagesuidlist")@responbodypublic list<messages> messagesuidlist(@requestbody messages message) throws parexception {list<messages> list = null;if(message.gettype() != null && message.gettype() == 1) {message.ttime(new date());list = messagesrvice.lectmessagespai(message);}el {list = messagesrvice.lectmessagestwo(message); }messages me = new messages();me.ttype(1);me.ttime(new date());for (int i = 0; i < list.size(); i++) {me.tdid(list.get(i).getdid());list<messages> lin = messagesrvice.lectmessagespai(me);list.get(i).tage(lin.size());}return list;}/***预约信息列表* @throws parexception */@requestmapping(value = "/messageslist")@responbodypublic list<messages> messageslist(@requestparam("type")integer type,@requestparam("uid")integer uid) throws parexception {messages message = new messages();list<messages> list = null;message.ttype(type);message.tuid(uid);if(type != null && type == 1) {message.ttime(new date());list = messagesrvice.lectmessagespai(message); messages me = new messages();me.ttype(1);me.ttime(new date());for (int i = 0; i < list.size(); i++) {me.tdid(list.get(i).getdid());list<messages> lin = messagesrvice.lectmessagespai(me);list.get(i).tage(lin.size());}}el {list = messagesrvice.lectmessagestwo(message); }return list;}/***预约信息列表* @throws parexception */@requestmapping(value = "/messageslists")@responbodypublic list<messages> messageslists(integer uid) throws parexception {messages message = new messages();message.tuid(uid);list<messages> list = messagesrvice.lectmessagestwo(message);messages me = new messages();me.ttype(1);me.ttime(new date())护理管理学;for (int i = 0; i < list.size(); i++) {if(list.get(i).gettype() == 1) {me.tdid(list.get(i).getdid());list<messages> lin = messagesrvice.lectmessagespai(me);list.get(i).tage(lin.size()); }}return list;}/** * @throws parexception */@requestmapping(value = "/doctortoulist")@responbodypublic list<doctor> doctortoulist() {pageinfo<doctor> pageinfo = doctorrvice.lectdoctorlist(null,1,4);return pageinfo.getlist();}/** * @throws parexception */@requestmapping(value = "/datatimegua")@responbodypublic integer datatimegua(@requestparam("datetime")string datetime,@requestparam("did")integer did) throws parexception {simpledateformat sdf = new simpledateformat("yyyy-mm-dd");date par = sdf.par(datetime);messages message = new messages();message.ttime(par);message.tdid(did);message.ttype(-1);list<messages> list = messagesrvice.lectmessages(message);return list.size();}}
登录控制层:
/*** 登录控制层*/@controller@requestmapping("/login")public class logincontroller {@autowiredprivate adminrvice adminrvice;@autowiredprivate doctorrvice doctorrvice;@autowiredprivate ctionrvice ctionrvice;@autowiredprivate patientrvice patientrvice;@value("${fileurl}") //在配置文件中获取文件的保存路径private string filepath;/*** 后台登陆界面* @throws ioexception */@requestmapping("/afterview")public string afterlogin(integer type,model model) {if(type == null) {type = 1;}model.addattribute("type",type);return "login";}/*** 后台登陆界面*/@requestmapping("/index")public string index(integer type,model model) {if(type == null){type = 1;}model.addattribute("type",type);return "login";}/*** 后台登陆界面*/@requestmapping("/font/index")public string fontindex(integer type,model model) {if(type == null){type = 3;}model.addattribute("type",type);return "loginbypatient";}/* public static void main(string[] args) {string filename ="c:\\urs\\administrator\\pictures\\项目图片\\1156.jpg_wh1200.jpg";int indexof = filename.indexof(".");string substring = filename.substring(indexof); system.out.println(substring);}*//*** 医生图片上传* @param mufile* @param id* @return* @throws ioexception*/@requestmapping(value ="/zixunadd")@responbodypublic map<string, object> zixunadd(@requestparam("mf")multipartfile mufile,@requestparam("id")integer id) throws ioexception{map<string, object> map = new hashmap<string, object>();string random = stringrandom.getrandom();string filename = mufile.getoriginalfilename();//随机字符+原图片名用作新的图片名filename = random+".jpg";try {//文件保存路径 d:/xxxx/xxxx/file file = new file(filepath+filename);//判断父级文件是否存在if (!file.getparentfile().exists()) {file.getparentfile().mkdir();}mufile.transferto(file);} catch (illegalstateexception | ioexception e) {e.printstacktrace();}doctor doctor = new doctor(); if(id != -1){doctor.tid(id);doctor.timg("/files/"+filename);doctorrvice.updatebyprimarykeylective(doctor);}el {//添加图片路径doctor.timg("/files/"+filename);doctorrvice.inrtlective(doctor);system.out.println("id:"+doctor.getid());map.put("id",doctor.getid());}return map;}/*** 判断管理员账号*/@requestmapping("/ctionxlist")@responbodypublic list<ction> ctionxlist(model model, integer id) {list<ction> lectbyexample = null;if(id != null) {ction ction = new ction();ction.tpid(id);lectbyexample = ctionrvice.lectbyexample(ction);}return lectbyexample;} /*** 判断管理员账号*/@requestmapping("/mimaupate")@responbodypublic map<string,string> passwordupate(model model, string zhanghao) {map<string, string> map = new hashmap<string, string>();admin ad = new admin();ad.turname(zhanghao);list<admin> lectadmin = adminrvice.lectadmin(ad);if(lectadmin.size() > 0){map.put("pan","err");}el{map.put("pan","ok");}return map;}/*** 判断医生账号*/@requestmapping("/panzhanghao")@responbodypublic map<string,string> panzhanghao(model model, string zhanghao) {map<string, string> map = new hashmap<string, string>();doctorexample = new doctorexample();doctorexample.criteria criteria = .createcriteria();criteria.andurnameequalto(zhanghao);list<doctor> lectbyexample = doctorrvice.lectbyexample();if(lectbyexample.size() > 0){map.put("pan","err");}el{map.put("pan","ok");}return map;}/*** 医生添加* @param model* @param zixun* @return*/@requestmapping("/zixuninrt")public string zixuninrt(model model,doctor doctor){if(doctor.getid() != null){if(doctor.getsid() != null) {ction lectbyprimarykey = ctionrvice.lectbyprimarykey(doctor.getsid());doctor.tsname(lectbyprimarykey.getname());}doctorrvice.updatebyprimarykeylective(doctor);}model.addattribute("type",1);return "login";}/*** 管理员注册界面*/@requestmapping("/mimapageuptate")public string mimapageuptate(integer type,model model) {//1医生 2 管理员if(type == 1 ) {return "doctorregister";}return "adminregister";}/*** 医生注册界面*/@requestmapping("/doctorregisterpage")public string doctorregister(model model) {list<ction> ctionlist2 = null;ction = new ction();.ttype(1);list<ction> ctionlist = ctionrvice.lectbyexample();if(ctionlist.size() > 0 ) {//科室详情ction ction = new ction();ction.tpid(ctionlist.get(0).getid());ction.ttype(2);ctionlist2 = ctionrvice.lectbyexample(ction);}model.addattribute("ctionlist", ctionlist);model.addattribute("ctionlist2", ctionlist2);return "doctorregister";}/*** 管理员注册*/@requestmapping("/admin_register")public string admin_register(admin admin,model model) {int inrtlective = adminrvice.inrtlective(admin);model.addattribute("type",2);return "login";}/*** 登陆验证* @return*/@requestmapping("/verificatio")public string verificatio(string urname, string password, integer type, httprvletrequest request,model model) {httpssion ssion = request.getssion();ssion.tattribute("type",type);//类型为1是医院 2是管理员if(type == 1){doctor doctor = new doctor();doctor.turname(urname);doctor.tpasswoed(password);list<doctor> doctorlist = doctorrvice.lectdoctor(doctor);if(doctorlist.size() <= 0){model.addattribute("message","密码错误");model.addattribute("type",type);return "login";}ssion.tattribute("doctor",doctorlist.get(0));return "redirect:/doctor/index";}if(type == 3){patient patient = new patient();patient.turname(urname);patient.tpassword(password);list<patient> list = patientrvice.lectpatient(patient);if(list.size() <= 0) {model.addattribute("message","密码错误");model.addattribute("type",type);return "loginbypatient";}ssion.tattribute("patient",list.get(0));return "redirect:/api/doctorlist1";}admin admin = new admin();admin.turname(urname);admin.tpassword(password);list<admin> adminlist = adminrvice.lectadmin(admin);if(adminlist.size() <= 0){model.addattribute("message","密码错误");model.addattribute("type",type);return "login";}ssion.tattribute("admin",adminlist.get(0));return "redirect:/admin/index";}/*** 退出登录* @param request* @return*/@requestmapping("/ssioninvalidate")public string boot(httprvletrequest request,model model) {httpssion ssion = request.getssion();integer type = (integer) ssion.getattribute("type");if(type == null){type=1;}if(type == 3){model.addattribute("type",type);ssion.invalidate(); //ssion销毁return "loginbypatient";}model.addattribute("type",type);ssion.invalidate(); //ssion销毁return "login";}/**//*** 跳转忘记密码界面*//*@requestmapping("/mimapageuptate")public string passwordupate() {return "behind/merchant/mibaouptate";}*//*** 修改密码*//*@requestmapping("/mimaupate")@responbodypublic map<string,string> passwordupate(model model, string mima, string mibao, string zhanghao) {map<string, string> map = new hashmap<string, string>();merchant me = new merchant();me.tzhanghao(zhanghao);me.tmibao(mibao);list<merchant> list = merchantrvice.lectmerchant(me);if(list.size() > 0){merchant me2 = new merchant();me2.tid(list.get(0).getid());me2.tmima(mima);merchantrvice.updatebyprimarykeylective(me2);map.put("pan","ok");}el{map.put("pan","err");}return map;}*//*** 后台登陆界面* @return*//*@requestmapping("/afterview")public string afterlogin(integer type,model model) {if(type == null){type = 1;}model.addattribute("type",type);return "behind/login";}*//*** 登陆验证* @return*//*@requestmapping("/verificatio")public string signin(string urname, string password, integer type, httprvletrequest request,model model) {httpssion ssion = request.getssion();ssion.tattribute("type",type);//类型为1是商户后台 2是管理员if(type == 1){merchant merchant = new merchant();merchant.tzhanghao(urname);merchant.tmima(password);merchant.tstate(1);list<merchant> merchants = merchantrvice.lectmerchant(merchant);if(merchants.size() <= 0){model.addattribute("message","密码错误");model.addattribute("type",type);return "behind/login";}ssion.tattribute("merchant",merchants.get(0));return "redirect:/merchant/index";}admin admin = new admin();admin.turname(urname);admin.tpassword(password);list<admin> adminlist = adminrvice.lectadmin(admin);if(adminlist.size() <= 0){model.addattribute("message","密码错误");model.addattribute("type",type);return "behind/login";}ssion.tattribute("admin",adminlist.get(0));return "redirect:/admin/index";}*//*** 退出登录* @param request* @return*//*@requestmapping("/ssioninvalidate")public string boot(httprvletrequest request,model model) {httpssion ssion = request.getssion();integer type = (integer) ssion.getattribute("type");if(type == null){type=1;}model.addattribute("type",type);ssion.invalidate(); //ssion销毁return "behind/login";}*//*** 管理员修改密码界面* @return*//*@requestmapping("/adminuptatepage")public string adminuptatepage(model model) {return "behind/admin/adminuptate";}*//*** 商户修改密码界面* @return*//*@requestmapping("/merchantuptate")public string merchantuptate(model model) {return "behind/merchant/merchantuptate";}*/}
医生端:
/*** 医生端*/@controller@requestmapping("/doctor")public class doctorcontroller {@autowiredprivate adminrvice adminrvice;@autowiredprivate doctorrvice doctorrvice;@autowiredprivate ctionrvice ctionrvice;@autowiredprivate patientrvice patientrvice;@autowiredprivate messagesrvice messagesrvice;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,httprvletrequest request) {httpssion ssion = request.getssion();doctor dt = (doctor) ssion.getattribute("doctor");if(dt == null) {return "redirect:/login/index"; }int doctor = doctorrvice.countbyexample(null); //医生总数int ction = ctionrvice.count(); //科室总数//患者总数int patient = 0;list<patient> lectbyexample = patientrvice.lectbyexample(null);messages mess = new messages();for (patient pa : lectbyexample) {if(pa.getname() != null) {mess.tdid(dt.getid());mess.turname(pa.getname());list<messages> lectmessages = messagesrvice.lectmessages(mess);if(lectmessages.size() > 0 ){patient++;}}}//预约总数messagexample me = new messagexample();messagexample.criteria mecriteria = me.createcriteria();mecriteria.anddidequalto(dt.getid());int messages = messagesrvice.countbyexample(me); model.addattribute("doctor",doctor);model.addattribute("ction",ction);model.addattribute("patient",patient);model.addattribute("messages",messages);pageinfo<doctor> pageinfo = doctorrvice.lectdoctorlist(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());}el {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,httprvletrequest request) {httpssion ssion = request.getssion();doctor dt = (doctor) ssion.getattribute("doctor");if(dt != null) {doctor doctor = doctorrvice.lectbyprimarykey(dt.getid());list<ction> ctionlist2 = null;model.addattribute("doctor",doctor);//科室ction = new ction();.ttype(1);list<ction> ctionlist = ctionrvice.lectbyexample();model.addattribute("ctionlist", ctionlist);//科室详情ction 1 = ctionrvice.lectbyprimarykey(doctor.getsid());if(1 != null) {ction ction = new ction();ction.tpid(1.getpid());ction.ttype(2);ctionlist2 = ctionrvice.lectbyexample(ction);model.addattribute("ctionlist2", ctionlist2);model.addattribute("1", 1);} }return "doctor/doctoruptate";}/*** 修改医生信息*/@requestmapping("/messagetime")public string messagetime(string name,model model,httprvletrequest request) {httpssion ssion = request.getssion();doctor dt = (doctor) ssion.getattribute("doctor");if(name != null) {messages mess = new messages();mess.tdid(dt.getid());mess.turname(name);list<messages> lectmessages = messagesrvice.lectmessagestwo(mess);model.addattribute("messageslist", lectmessages);}return "doctor/messagetime";}/*** 修改医生信息*/@requestmapping("/admindoctoruptate")public string adminuptatepassword(doctor doctor,model model) {if(doctor != null && doctor.getid() != null) {if(doctor.getsid() != null) {ction ction = ctionrvice.lectbyprimarykey(doctor.getsid());doctor.tsid(ction.getid());doctor.tsname(ction.getname());}doctorrvice.updatebyprimarykeylective(doctor);}return "redirect:/doctor/index";}/*** 预约信息列表*/@requestmapping("/messagelist")public string doctorlist(model model, messages messages, @requestparam(value="page",defaultvalue="1")integer page,integer type,httprvletrequest request) {if(messages == null) {messages = new messages();}httpssion ssion = request.getssion();doctor dt = (doctor) ssion.getattribute("doctor");if(dt != null){messages.tdid(dt.getid());}el{return "redirect:/login/index";}messages.ttype(type);//底层数据pageinfo<messages> pageinfo = messagesrvice.lectmessageslist(messages,page,size);//工作区数据messages.ttime(new date());list<messages> list = messagesrvice.lectmessagespai(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")@responbodypublic list<messages> doctorlist(httprvletrequest request) {messagesmessages = new messages();httpssion ssion = request.getssion();doctor dt = (doctor) ssion.getattribute("doctor");messages.tdid(dt.getid());messages.ttype(1);messages.ttime(new date());pageinfo<messages> pageinfo2 = messagesrvice.lectmessageslistdemo(messages,1,99);return pageinfo2.getlist();} /***医生列表查询*/@requestmapping(value = "/messagesqundinguptate")@responbodypublic string messagesqundinguptate(integer id) {if(id != null) {messages messages = new messages();messages.tid(id);messages.ttype(3); //3表示预约成功messagesrvice.updatebyprimarykeylective(messages);messages lectbyprimarykey = messagesrvice.lectbyprimarykey(id);messages mes = new messages();mes.ttype(1);mes.ttime(new date());mes.tdid(lectbyprimarykey.getdid());list<messages> list = messagesrvice.lectmessagespai(mes);for (int i = 0; i < list.size(); i++) {list.get(i).tpai(i+1);messagesrvice.updatebyprimarykeylective(list.get(i));}}return "ok";} /***患者信息列表*/@requestmapping("/patientlist")public string messagelist(model model, patient patient, @requestparam(value="page",defaultvalue="1")integer page,httprvletrequest request) {if(patient == null) {patient = new patient();}httpssion ssion = request.getssion();doctor dt = (doctor) ssion.getattribute("doctor");if(dt == null){return "redirect:/login/index";}/** pageinfo<patient> pageinfo =* patientrvice.lectpatientlist(patient,1,size); list<patient> list =* pageinfo.getlist(); list<patient> list2 = new arraylist<patient>(); messages* messages = new messages(); boolean pan = fal; simpledateformat sdf = new* simpledateformat("yyyy-mm-dd"); for (patient pa : list) { if(pa.getpid() !=* null && pa.getpid() != 0){ messages.tdid(dt.getid());* messages.tuid(pa.getpid()); messages.turname(pa.getname());* list<messages> ml = messagesrvice.lectmessages(messages); if(ml.size() >* 0 ){ date time = ml.get(0).gettime(); pa.turname(sdf.format(time));* pa.tph主要工作one(dt.getname()); pa.tidentitys(dt.getsname()); list2.add(pa); }* * } } if(list2.size() <= 8) { pageinfo.tpages(1); }*/messages messages = new messages();// messages.ttime(new date());messages.ttype(1);messages.tdid(dt.getid()); pageinfo<messages> pageinfo = messagesrvice.lectmessageslist(messages, 1, size);model.addattribute("doctorlist",pageinfo.getlist());model.addattribute("pageinfo",pageinfo);model.addattribute("patient",patient);return "doctor/patientlist";}/***预约信息列表* @throws parexception */@requestmapping(value = "/tiaozhuanlist")@responbodypublic string messageslist(@requestparam("xiao")integer xiao,@requestparam("da")integer da) {messages message = new messages();if(xiao != null & da != null) {messages mexiao = messagesrvice.lectbyprimarykey(xiao);integer px = mexiao.getpai();messages meda = messagesrvice.lectbyprimarykey(da);mexiao.tpai(meda.getpai());meda.tpai(px);messagesrvice.updatebyprimarykeylective(mexiao);messagesrvice.updatebyprimarykeylective(meda);}return null;}/*** 确定预约*/@requestmapping("/messagesuptate")public string messagesuptate(integer id) {if(id != null) {messages messages = new messages();messages.tid(id);messages.ttype(3); //3表示预约成功messagesrvice.updatebyprimarykeylective(messages);}return "redirect:/doctor/messagelist?type=1";}/*** 取消*/@requestmapping("/messagesquxiao")public string messagesquxiao(integer id) {if(id != null) {messages messages = new messages();messages.tid(id);messages.ttype(2); //2取消预约messagesrvice.updatebyprimarykeylective(messages);}return "redirect:/doctor/messagelist?type=1";}/*** 退号*/@requestmapping("/messagestui")public string messagestui(integer id) {if(id != null) {messages messages = new messages();messages.tid(id);messages.ttype(4); //4退号失败messagesrvice.updatebyprimarykeylective(messages);}return "redirect:/doctor/messagelist?type=3";}}
到此这篇关于java毕业设计实战之宠物医院与商城一体的系统的实现的文章就介绍到这了,更多相关java 宠物医院内容请搜索www.887551.com以前的文章或继续浏览下面的相关文章希望大家以后多多支持www.887551.com!
本文发布于:2023-04-04 21:58:49,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/8cff84accdedb0c36dacdafb67a388f7.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:Java毕业设计实战之宠物医院与商城一体的系统的实现.doc
本文 PDF 下载地址:Java毕业设计实战之宠物医院与商城一体的系统的实现.pdf
留言与评论(共有 0 条评论) |