From 9f5bd59065c7575c1521d00aab4ab2b67f15baec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=85=95=E6=B6=B5?= <2292559624@qq.com> Date: Thu, 24 Nov 2022 23:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 22 ++++ src/HelloWorld.vue | 113 +++++++++++++++++++ src/Home.vue | 20 ++++ src/HosdataApplication.java | 13 +++ src/Login.vue | 91 +++++++++++++++ src/assets/logo.png | Bin 0 -> 6849 bytes src/controller/DoctorController.java | 20 ++++ src/controller/DocyzController.java | 35 ++++++ src/controller/InController.java | 32 ++++++ src/controller/LoginController.java | 49 +++++++++ src/controller/RegisterController.java | 46 ++++++++ src/controller/ShopController.java | 46 ++++++++ src/controller/ZhuController.java | 27 +++++ src/dao/DocDAO.java | 12 ++ src/dao/DoctorDAO.java | 10 ++ src/dao/InDAO.java | 12 ++ src/dao/RegisterDAO.java | 15 +++ src/dao/ShopDAO.java | 10 ++ src/dao/ShopRecordDAO.java | 10 ++ src/dao/UserDAO.java | 18 +++ src/dao/ZhuDAO.java | 12 ++ src/main.js | 21 ++++ src/pojo/Doctor.java | 40 +++++++ src/pojo/Docyz.java | 76 +++++++++++++ src/pojo/Information.java | 52 +++++++++ src/pojo/Medicine.java | 60 ++++++++++ src/pojo/RegisterRecord.java | 74 +++++++++++++ src/pojo/ShopRecord.java | 48 ++++++++ src/pojo/User.java | 52 +++++++++ src/pojo/Zhuce.java | 52 +++++++++ src/register/RegisterIndex.vue | 128 +++++++++++++++++++++ src/result/Result.java | 19 ++++ src/router/index.js | 123 +++++++++++++++++++++ src/service/DoctorService.java | 21 ++++ src/service/DocyzService.java | 27 +++++ src/service/InService.java | 26 +++++ src/service/RegisterService.java | 35 ++++++ src/service/ShopService.java | 39 +++++++ src/service/UserService.java | 38 +++++++ src/service/ZhuService.java | 23 ++++ src/setting/SettingIndex.vue | 147 +++++++++++++++++++++++++ src/shop/ShopIndex.vue | 99 +++++++++++++++++ src/shoprecords/ShoprecordIndex.vue | 56 ++++++++++ src/treatment/TreatmentIndex.vue | 71 ++++++++++++ src/zhu/ZhuceIndex.vue | 83 ++++++++++++++ 45 files changed, 2023 insertions(+) create mode 100644 src/App.vue create mode 100644 src/HelloWorld.vue create mode 100644 src/Home.vue create mode 100644 src/HosdataApplication.java create mode 100644 src/Login.vue create mode 100644 src/assets/logo.png create mode 100644 src/controller/DoctorController.java create mode 100644 src/controller/DocyzController.java create mode 100644 src/controller/InController.java create mode 100644 src/controller/LoginController.java create mode 100644 src/controller/RegisterController.java create mode 100644 src/controller/ShopController.java create mode 100644 src/controller/ZhuController.java create mode 100644 src/dao/DocDAO.java create mode 100644 src/dao/DoctorDAO.java create mode 100644 src/dao/InDAO.java create mode 100644 src/dao/RegisterDAO.java create mode 100644 src/dao/ShopDAO.java create mode 100644 src/dao/ShopRecordDAO.java create mode 100644 src/dao/UserDAO.java create mode 100644 src/dao/ZhuDAO.java create mode 100644 src/main.js create mode 100644 src/pojo/Doctor.java create mode 100644 src/pojo/Docyz.java create mode 100644 src/pojo/Information.java create mode 100644 src/pojo/Medicine.java create mode 100644 src/pojo/RegisterRecord.java create mode 100644 src/pojo/ShopRecord.java create mode 100644 src/pojo/User.java create mode 100644 src/pojo/Zhuce.java create mode 100644 src/register/RegisterIndex.vue create mode 100644 src/result/Result.java create mode 100644 src/router/index.js create mode 100644 src/service/DoctorService.java create mode 100644 src/service/DocyzService.java create mode 100644 src/service/InService.java create mode 100644 src/service/RegisterService.java create mode 100644 src/service/ShopService.java create mode 100644 src/service/UserService.java create mode 100644 src/service/ZhuService.java create mode 100644 src/setting/SettingIndex.vue create mode 100644 src/shop/ShopIndex.vue create mode 100644 src/shoprecords/ShoprecordIndex.vue create mode 100644 src/treatment/TreatmentIndex.vue create mode 100644 src/zhu/ZhuceIndex.vue diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..a2a7be5 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/HelloWorld.vue b/src/HelloWorld.vue new file mode 100644 index 0000000..1c19f2a --- /dev/null +++ b/src/HelloWorld.vue @@ -0,0 +1,113 @@ + + + + + + diff --git a/src/Home.vue b/src/Home.vue new file mode 100644 index 0000000..d5986c5 --- /dev/null +++ b/src/Home.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/HosdataApplication.java b/src/HosdataApplication.java new file mode 100644 index 0000000..4d34f26 --- /dev/null +++ b/src/HosdataApplication.java @@ -0,0 +1,13 @@ +package com.example.hosdata; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HosdataApplication { + + public static void main(String[] args) { + SpringApplication.run(HosdataApplication.class, args); + } + +} diff --git a/src/Login.vue b/src/Login.vue new file mode 100644 index 0000000..f015593 --- /dev/null +++ b/src/Login.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3d2503fc2a44b5053b0837ebea6e87a2d339a43 GIT binary patch literal 6849 zcmaKRcUV(fvo}bjDT-7nLI_nlK}sT_69H+`qzVWDA|yaU?}j417wLi^B1KB1SLsC& zL0ag7$U(XW5YR7p&Ux?sP$d4lvMt8C^+TcQu4F zQqv!UF!I+kw)c0jhd6+g6oCr9P?7)?!qX1ui*iL{p}sKCAGuJ{{W)0z1pLF|=>h}& zt(2Lr0Z`2ig8<5i%Zk}cO5Fm=LByqGWaS`oqChZdEFmc`0hSb#gg|Aap^{+WKOYcj zHjINK)KDG%&s?Mt4CL(T=?;~U@bU2x_mLKN!#GJuK_CzbNw5SMEJorG!}_5;?R>@1 zSl)jns3WlU7^J%=(hUtfmuUCU&C3%8B5C^f5>W2Cy8jW3#{Od{lF1}|?c61##3dzA zsPlFG;l_FzBK}8>|H_Ru_H#!_7$UH4UK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L99RtQ>m(%#nQ#wrRC8Y%yxkH;d!MdY+Tw@r zjpSnK`;C-U{ATcgaxoEpP0Gf+tx);buOMlK=01D|J+ROu37qc*rD(w`#O=3*O*w9?biwNoq3WN1`&Wp8TvKj3C z3HR9ssH7a&Vr<6waJrU zdLg!ieYz%U^bmpn%;(V%%ugMk92&?_XX1K@mwnVSE6!&%P%Wdi7_h`CpScvspMx?N zQUR>oadnG17#hNc$pkTp+9lW+MBKHRZ~74XWUryd)4yd zj98$%XmIL4(9OnoeO5Fnyn&fpQ9b0h4e6EHHw*l68j;>(ya`g^S&y2{O8U>1*>4zR zq*WSI_2o$CHQ?x0!wl9bpx|Cm2+kFMR)oMud1%n2=qn5nE&t@Fgr#=Zv2?}wtEz^T z9rrj=?IH*qI5{G@Rn&}^Z{+TW}mQeb9=8b<_a`&Cm#n%n~ zU47MvCBsdXFB1+adOO)03+nczfWa#vwk#r{o{dF)QWya9v2nv43Zp3%Ps}($lA02*_g25t;|T{A5snSY?3A zrRQ~(Ygh_ebltHo1VCbJb*eOAr;4cnlXLvI>*$-#AVsGg6B1r7@;g^L zFlJ_th0vxO7;-opU@WAFe;<}?!2q?RBrFK5U{*ai@NLKZ^};Ul}beukveh?TQn;$%9=R+DX07m82gP$=}Uo_%&ngV`}Hyv8g{u z3SWzTGV|cwQuFIs7ZDOqO_fGf8Q`8MwL}eUp>q?4eqCmOTcwQuXtQckPy|4F1on8l zP*h>d+cH#XQf|+6c|S{7SF(Lg>bR~l(0uY?O{OEVlaxa5@e%T&xju=o1`=OD#qc16 zSvyH*my(dcp6~VqR;o(#@m44Lug@~_qw+HA=mS#Z^4reBy8iV?H~I;{LQWk3aKK8$bLRyt$g?- listByDepartment(String department) throws Exception { + return doctorService.listByDepartment(department); + } +} diff --git a/src/controller/DocyzController.java b/src/controller/DocyzController.java new file mode 100644 index 0000000..833b028 --- /dev/null +++ b/src/controller/DocyzController.java @@ -0,0 +1,35 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Docyz; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DocyzService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +public class DocyzController { + @Autowired + DocyzService docService; + + @CrossOrigin + @PostMapping("/api/docrecords") + public Docyz addOrUpdate(@RequestBody Docyz doc) throws Exception { + docService.addOrUpdate(doc); + return doc; + } + + /* @CrossOrigin + @GetMapping("/api/docrecords") + public List listdoctorname() throws Exception { + return docService.listBydoctorname(); + }*/ + + @CrossOrigin + @GetMapping("/api/treatment") + public List listghname() throws Exception { + return docService.listByghname(); + } +} diff --git a/src/controller/InController.java b/src/controller/InController.java new file mode 100644 index 0000000..71048f8 --- /dev/null +++ b/src/controller/InController.java @@ -0,0 +1,32 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.InService; +import com.example.hosdata.service.RegisterService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class InController { + @Autowired + InService inService; + + @CrossOrigin + @GetMapping("/api/setting") + public List listuser() throws Exception { + return inService.listbyuser(); + } + + @CrossOrigin + @PostMapping("/api/setting") + public Information Update(@RequestBody Information information) throws Exception { + inService.update(information); + return information; + } +} diff --git a/src/controller/LoginController.java b/src/controller/LoginController.java new file mode 100644 index 0000000..e9c637c --- /dev/null +++ b/src/controller/LoginController.java @@ -0,0 +1,49 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import com.example.hosdata.result.Result; +import com.example.hosdata.service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@Controller +public class LoginController { + + @Autowired + UserService userService; + + @CrossOrigin + @PostMapping(value = "/api/login") + @ResponseBody + public Result login(@RequestBody User requestUser) { + String username = requestUser.getUsername(); + username = HtmlUtils.htmlEscape(username); + String id = requestUser.getId(); + id = HtmlUtils.htmlEscape(id); + String realname = requestUser.getRealname(); + realname = HtmlUtils.htmlEscape(realname); + + User user = userService.getall(id,username, requestUser.getPassword(),realname); + //String id=requestUser.getId(); + RegisterService.username = username; + DocyzService.ghname = realname; + DocyzService.doctorname = realname; + ShopService.myzh = username; + InService.userna = username; + if (null == user) { + return new Result(400); + } else if(id.equals("医务人员")){ + return new Result(100); + } else if(id.equals("管理员")){ + return new Result(300); + }else { + return new Result(200); + } + } +} + diff --git a/src/controller/RegisterController.java b/src/controller/RegisterController.java new file mode 100644 index 0000000..145d6a0 --- /dev/null +++ b/src/controller/RegisterController.java @@ -0,0 +1,46 @@ +package com.example.hosdata.controller; + + +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.RegisterService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class RegisterController { + @Autowired + RegisterService Reservice; + + @CrossOrigin + @GetMapping("/api/records") + public List list() throws Exception { + return Reservice.listByname(); + } + + @CrossOrigin + @GetMapping("/api/docrecords") + public List listdoc() throws Exception { + return Reservice.list(); + } + + /*@CrossOrigin + @PostMapping("/api/docrecords") + public List searchResult(@RequestParam(value="doctor",required=false) String doctor) { + return Reservice.Search(doctor); + }*/ + + + @CrossOrigin + @PostMapping("/api/register") + public RegisterRecord addOrUpdate(@RequestBody RegisterRecord record) throws Exception { + Reservice.addOrUpdate(record); + return record; + } + +} + diff --git a/src/controller/ShopController.java b/src/controller/ShopController.java new file mode 100644 index 0000000..65955d1 --- /dev/null +++ b/src/controller/ShopController.java @@ -0,0 +1,46 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Medicine; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.ShopRecord; +import com.example.hosdata.service.ShopService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +public class ShopController { + + @Autowired + ShopService shopService; + + @ResponseBody + @CrossOrigin + @GetMapping(value = "/api/shop") + public List shop() { + return shopService.MedicineList(); + } + + @CrossOrigin + @PostMapping("/api/shop") + public ShopRecord Add(@RequestBody ShopRecord SR) throws Exception { + shopService.addOrUpdate(SR); + return SR; + } + + @CrossOrigin + @PostMapping("/api/Admin") + public Medicine Update(@RequestBody Medicine medicine) throws Exception { + shopService.Update(medicine); + return medicine; + } + + @CrossOrigin + @GetMapping("/api/shoprecords") + public List listbymyzh() throws Exception { + return shopService.listBymyzh(); + } + +} diff --git a/src/controller/ZhuController.java b/src/controller/ZhuController.java new file mode 100644 index 0000000..279da7f --- /dev/null +++ b/src/controller/ZhuController.java @@ -0,0 +1,27 @@ +package com.example.hosdata.controller; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.Zhuce; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.InService; +import com.example.hosdata.service.RegisterService; + +import com.example.hosdata.service.ZhuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class ZhuController { + @Autowired + ZhuService zhuService; + + @CrossOrigin + @PostMapping("/api/zhu") + public Zhuce add(@RequestBody Zhuce zhuce) throws Exception { + zhuService.add(zhuce); + return zhuce; + } +} diff --git a/src/dao/DocDAO.java b/src/dao/DocDAO.java new file mode 100644 index 0000000..5b90df4 --- /dev/null +++ b/src/dao/DocDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Docyz; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface DocDAO extends JpaRepository { + List findByGhname(String ghname); + + List findByDoctorname(String doctorname); +} diff --git a/src/dao/DoctorDAO.java b/src/dao/DoctorDAO.java new file mode 100644 index 0000000..9405b0b --- /dev/null +++ b/src/dao/DoctorDAO.java @@ -0,0 +1,10 @@ +package com.example.hosdata.dao; +import java.util.*; +import com.example.hosdata.pojo.Doctor; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface DoctorDAO extends JpaRepository { + List findAllByDepartment(String department); + List findAllByDoctorname(String doctorname); +} diff --git a/src/dao/InDAO.java b/src/dao/InDAO.java new file mode 100644 index 0000000..a3207cd --- /dev/null +++ b/src/dao/InDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface InDAO extends JpaRepository{ + List findByUsername(String username); +} diff --git a/src/dao/RegisterDAO.java b/src/dao/RegisterDAO.java new file mode 100644 index 0000000..c1ef457 --- /dev/null +++ b/src/dao/RegisterDAO.java @@ -0,0 +1,15 @@ +package com.example.hosdata.dao; + + +import com.example.hosdata.pojo.RegisterRecord; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface RegisterDAO extends JpaRepository { + List findByUsername(String username); + + List findByDoctor(String doctor); + +} diff --git a/src/dao/ShopDAO.java b/src/dao/ShopDAO.java new file mode 100644 index 0000000..d0a9c45 --- /dev/null +++ b/src/dao/ShopDAO.java @@ -0,0 +1,10 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Medicine; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface ShopDAO extends JpaRepository { + List findAllByPlace(String place); +} diff --git a/src/dao/ShopRecordDAO.java b/src/dao/ShopRecordDAO.java new file mode 100644 index 0000000..55bd1c9 --- /dev/null +++ b/src/dao/ShopRecordDAO.java @@ -0,0 +1,10 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Medicine; +import com.example.hosdata.pojo.ShopRecord; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface ShopRecordDAO extends JpaRepository { + List findByMyzh(String myzh); +} diff --git a/src/dao/UserDAO.java b/src/dao/UserDAO.java new file mode 100644 index 0000000..f3e1781 --- /dev/null +++ b/src/dao/UserDAO.java @@ -0,0 +1,18 @@ +package com.example.hosdata.dao; +import com.example.hosdata.pojo.User; +import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + +public interface UserDAO extends JpaRepository { + User findByUsername(String username); + + User getByUsernameAndPassword(String username,String password); + + User getByIdAndUsernameAndPassword(String id,String username,String password); + + User getByIdAndUsernameAndPasswordAndRealname(String id,String username,String password,String realname); + +} + +//操作数据库的对象,使用了JPA,无需手动构建SQL语句,而只需要按照规范提供方法的名字即可实现对数据库的增删查改 + diff --git a/src/dao/ZhuDAO.java b/src/dao/ZhuDAO.java new file mode 100644 index 0000000..140051d --- /dev/null +++ b/src/dao/ZhuDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import com.example.hosdata.pojo.Zhuce; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface ZhuDAO extends JpaRepository{ +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..471ed03 --- /dev/null +++ b/src/main.js @@ -0,0 +1,21 @@ +import Vue from 'vue' +import App from './App' +import router from './router' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' + +var axios = require('axios') +axios.defaults.baseURL = 'http://localhost:8443/api' +Vue.prototype.$axios = axios +Vue.config.productionTip = false + +Vue.use(ElementUI) + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + render: h => h(App), + router, + components: { App }, + template: '' +}) diff --git a/src/pojo/Doctor.java b/src/pojo/Doctor.java new file mode 100644 index 0000000..9160784 --- /dev/null +++ b/src/pojo/Doctor.java @@ -0,0 +1,40 @@ +package com.example.hosdata.pojo; +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "doctor") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class Doctor { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "doctorid") + int doctorid; + + String doctorname; + String department; + String worktime; + + public String getDoctorname() { + return doctorname; + } + public void setDoctorname(String doctorname) { + this.doctorname = doctorname; + } + + public String getDepartment() { + return department; + } + public void setDpartment(String department) { + this.department = department; + } + + public String getWorktime() { + return worktime; + } + public void setWorktime(String worktime) { + this.worktime = worktime; + } +} diff --git a/src/pojo/Docyz.java b/src/pojo/Docyz.java new file mode 100644 index 0000000..d2b62e0 --- /dev/null +++ b/src/pojo/Docyz.java @@ -0,0 +1,76 @@ +package com.example.hosdata.pojo; + +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "docyz") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class Docyz { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "idnumber") + int idnumber; + + String doctorname; + + String ghname; + int yyh; + String zhengz; + String zhend; + String liaoc; + + + public int getIdnumber() { + return idnumber; + } + public void setIdnumber(int idnumber) { + this.idnumber = idnumber; + } + + public String getDoctorname() { + return doctorname; + } + public void setDoctorname(String doctorname) { + this.doctorname = doctorname; + } + + public String getGhname() { + return ghname; + } + public void setGhname(String ghname) { + this.ghname = ghname; + } + + public int getYyh() { + return yyh; + } + public void setYyh(int yyh) { + this.yyh = yyh; + } + + public String getZhengz() { + return zhengz; + } + public void setZhengz(String zhengz) { + this.zhengz = zhengz; + } + + public String getZhend() { + return zhend; + } + public void setZhend(String zhend) { + this.zhend = zhend; + } + + public String getLiaoc() { + return liaoc; + } + public void setLiaoc(String liaoc) { + this.liaoc = liaoc; + } + +} + diff --git a/src/pojo/Information.java b/src/pojo/Information.java new file mode 100644 index 0000000..968ccb6 --- /dev/null +++ b/src/pojo/Information.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Information { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/pojo/Medicine.java b/src/pojo/Medicine.java new file mode 100644 index 0000000..40ab1b8 --- /dev/null +++ b/src/pojo/Medicine.java @@ -0,0 +1,60 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "medicine") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Medicine { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + int id; + + String name; + int number; + double price; + + String place; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public int getNumber() {return number;} + + public void setNumber(int number) { + this.number = number; + } + + + public double getPrice() {return price;} + + public void setPrice(double price) { + this.price = price; + } + + public String getPlace() {return place;} + + public void setPlace(String place) { + this.place = place; + } + +} diff --git a/src/pojo/RegisterRecord.java b/src/pojo/RegisterRecord.java new file mode 100644 index 0000000..1032245 --- /dev/null +++ b/src/pojo/RegisterRecord.java @@ -0,0 +1,74 @@ +package com.example.hosdata.pojo; +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "register") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class RegisterRecord { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "idnum") + int idnum; + + String name; + String department; + String major; + String time; + String doctor; + String username; + + + + public int getIdnum() { + return idnum; + } + public void setIdnum(int idnum) { + this.idnum = idnum; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDepartment() { + return department; + } + public void setDepartment(String department) { + this.department = department; + } + + public String getMajor() { + return major; + } + public void setMajor(String major) { + this.major = major; + } + + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + + public String getDoctor() { + return doctor; + } + public void setDoctor(String doctor) { + this.doctor = doctor; + } + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + +} diff --git a/src/pojo/ShopRecord.java b/src/pojo/ShopRecord.java new file mode 100644 index 0000000..cfe50f1 --- /dev/null +++ b/src/pojo/ShopRecord.java @@ -0,0 +1,48 @@ +package com.example.hosdata.pojo; + +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "shoprecord") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class ShopRecord { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "mid") + int mid; + + String medicine; + int number; + + String myzh; + + public String getMedicine() { + return medicine; + } + public void setMedicine(String medicine) { + this.medicine = medicine; + } + + public int getNumber() {return number;} + public void setNumber(int number) { + this.number = number; + } + + public int getMid() { + return mid; + } + public void setMid(int mid) { + this.mid = mid; + } + + public String getMyzh() { + return myzh; + } + public void setMyzh(String myzh) { + this.myzh = myzh; + } + +} diff --git a/src/pojo/User.java b/src/pojo/User.java new file mode 100644 index 0000000..c041957 --- /dev/null +++ b/src/pojo/User.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/pojo/Zhuce.java b/src/pojo/Zhuce.java new file mode 100644 index 0000000..9ad6b5a --- /dev/null +++ b/src/pojo/Zhuce.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Zhuce { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/register/RegisterIndex.vue b/src/register/RegisterIndex.vue new file mode 100644 index 0000000..dadd6f7 --- /dev/null +++ b/src/register/RegisterIndex.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/result/Result.java b/src/result/Result.java new file mode 100644 index 0000000..6cf46ec --- /dev/null +++ b/src/result/Result.java @@ -0,0 +1,19 @@ +package com.example.hosdata.result; + +public class Result { + //响应码 + private int code; + + public Result(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + +} diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..cda5260 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,123 @@ +import Vue from 'vue' +import Router from 'vue-router' +import AppIndex from '../components/home/AppIndex' +import Login from '../components/Login' +import Home from '../components/Home' +import RegisterIndex from '../components/register/RegisterIndex' +import ShopIndex from '../components/shop/ShopIndex' +import RecordIndex from '../components/records/RecordIndex' +import AdvanceIndex from '../components/advance/AdvanceIndex' +import DocrecordIndex from '../components/docrecords/DocrecordIndex' +import TreatmentIndex from '../components/treatment/TreatmentIndex' +import ShoprecordIndex from '../components/shoprecords/ShoprecordIndex' +import SettingIndex from '../components/setting/SettingIndex' +import ZhuceIndex from '../components/zhu/ZhuceIndex' +import AdminIndex from '../components/Admin/AdminIndex' + +Vue.use(Router) + +export default new Router({ + routes: [ + { + path: '/home', + name: 'Home', + component: Home, + redirect: '/index', + children: [ + { + path: '/index', + name: 'AppIndex', + component: AppIndex, + meta: { + requireAuth: true + } + }, + { + path: '/register', + name: 'RegisterIndex', + component: RegisterIndex, + meta: { + requireAuth: true + } + }, + { + path: '/shop', + name: 'ShopIndex', + component: ShopIndex, + meta: { + requireAuth: true + } + }, + { + path: '/records', + name: 'RecordIndex', + component: RecordIndex, + meta: { + requireAuth: true + } + }, + { + path: '/advance', + name: 'AdvanceIndex', + component: AdvanceIndex, + meta: { + requireAuth: true + } + }, + { + path: '/treatment', + name: 'TreatmentIndex', + component: TreatmentIndex, + meta: { + requireAuth: true + } + }, + { + path: '/shoprecords', + name: 'ShoprecordIndex', + component: ShoprecordIndex, + meta: { + requireAuth: true + } + }, + { + path: '/setting', + name: 'SettingIndex', + component: SettingIndex, + meta: { + requireAuth: true + } + } + ] + }, + { + path: '/docrecords', + name: 'DocrecordIndex', + component: DocrecordIndex, + meta: { + requireAuth: true + } + }, + { + path: '/login', + name: 'Login', + component: Login + }, + { + path: '/zhu', + name: 'ZhuceIndex', + component: ZhuceIndex, + meta: { + requireAuth: true + } + }, + { + path: '/Admin', + name: 'AdminIndex', + component: AdminIndex, + meta: { + requireAuth: true + } + } + ] +}) diff --git a/src/service/DoctorService.java b/src/service/DoctorService.java new file mode 100644 index 0000000..efb6ccc --- /dev/null +++ b/src/service/DoctorService.java @@ -0,0 +1,21 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.DoctorDAO; +import com.example.hosdata.pojo.Doctor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +public class DoctorService { + @Autowired + DoctorDAO doctorDAO; + + public List listByDepartment(String department) { + return doctorDAO.findAllByDepartment(department); + } + + public List listworktime(String doctor) { + return doctorDAO.findAllByDoctorname(doctor); + } +} diff --git a/src/service/DocyzService.java b/src/service/DocyzService.java new file mode 100644 index 0000000..55cff90 --- /dev/null +++ b/src/service/DocyzService.java @@ -0,0 +1,27 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.DocDAO; +import com.example.hosdata.pojo.Docyz; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; + +@Service +public class DocyzService { + @Autowired + DocDAO docDAO; + static public String ghname; + static public String doctorname; + + public void addOrUpdate(Docyz doc) { + docDAO.save(doc); + } + + public List listByghname() { + return docDAO.findByGhname(this.ghname); + } + + public List listBydoctorname() { + return docDAO.findByDoctorname(this.doctorname); + } +} diff --git a/src/service/InService.java b/src/service/InService.java new file mode 100644 index 0000000..33bf04b --- /dev/null +++ b/src/service/InService.java @@ -0,0 +1,26 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.InDAO; +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class InService { + @Autowired + InDAO inDAO; + static public String userna; + + public List listbyuser() { + return inDAO.findByUsername(userna); + } + + public void update(Information information) { + inDAO.save(information); + } +} diff --git a/src/service/RegisterService.java b/src/service/RegisterService.java new file mode 100644 index 0000000..0864d07 --- /dev/null +++ b/src/service/RegisterService.java @@ -0,0 +1,35 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.pojo.RegisterRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class RegisterService { + @Autowired + RegisterDAO reDAO; + static public String username; + + public List listByname() { + return reDAO.findByUsername(this.username); + } + + public void addOrUpdate(RegisterRecord record) { + reDAO.save(record); + } + + public List list() { + return reDAO.findAll(); + } + + public List Search(String doctor) { + return reDAO.findByDoctor(doctor); + } + +} + + diff --git a/src/service/ShopService.java b/src/service/ShopService.java new file mode 100644 index 0000000..1529aa7 --- /dev/null +++ b/src/service/ShopService.java @@ -0,0 +1,39 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.ShopDAO; +import com.example.hosdata.dao.ShopRecordDAO; +import com.example.hosdata.pojo.Medicine; +import com.example.hosdata.pojo.ShopRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ShopService { + public String place = "药房"; + + static public String myzh; + @Autowired + ShopDAO shopDAO; + + @Autowired + ShopRecordDAO shopRecordDAO; + + public List MedicineList(){ + return shopDAO.findAllByPlace(place); + } + + public void addOrUpdate(ShopRecord shopRecord) { + shopRecordDAO.save(shopRecord); + } + + public void Update(Medicine medicine) { + medicine.setPlace("药房"); + shopDAO.save(medicine); + } + + public List listBymyzh() { + return shopRecordDAO.findByMyzh(this.myzh); + } +} diff --git a/src/service/UserService.java b/src/service/UserService.java new file mode 100644 index 0000000..11d3c0e --- /dev/null +++ b/src/service/UserService.java @@ -0,0 +1,38 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.UserDAO; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class UserService { + @Autowired + UserDAO userDAO; + + public boolean isExist(String username) { + User user = getByName(username); + return null!=user; + } + + public User getByName(String username) { + return userDAO.findByUsername(username); + } + + public User get(String username, String password){ + return userDAO.getByUsernameAndPassword(username, password); + } + + public void add(User user) { + userDAO.save(user); + } + + public User getall(String id, String username, String password, String realname) { + return userDAO.getByIdAndUsernameAndPasswordAndRealname(id,username,password,realname); + } + +} +//在DAO中只定义基础的增删改查操作,而具体操作需要service来完成 diff --git a/src/service/ZhuService.java b/src/service/ZhuService.java new file mode 100644 index 0000000..668682f --- /dev/null +++ b/src/service/ZhuService.java @@ -0,0 +1,23 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.InDAO; +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.dao.ZhuDAO; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.Zhuce; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ZhuService { + @Autowired + ZhuDAO zhuDAO; + + public void add(Zhuce zhuce) { + zhuDAO.save(zhuce); + } +} diff --git a/src/setting/SettingIndex.vue b/src/setting/SettingIndex.vue new file mode 100644 index 0000000..79aff7e --- /dev/null +++ b/src/setting/SettingIndex.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/src/shop/ShopIndex.vue b/src/shop/ShopIndex.vue new file mode 100644 index 0000000..4ff9d37 --- /dev/null +++ b/src/shop/ShopIndex.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/shoprecords/ShoprecordIndex.vue b/src/shoprecords/ShoprecordIndex.vue new file mode 100644 index 0000000..bf0af64 --- /dev/null +++ b/src/shoprecords/ShoprecordIndex.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/treatment/TreatmentIndex.vue b/src/treatment/TreatmentIndex.vue new file mode 100644 index 0000000..df10415 --- /dev/null +++ b/src/treatment/TreatmentIndex.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/zhu/ZhuceIndex.vue b/src/zhu/ZhuceIndex.vue new file mode 100644 index 0000000..615f01a --- /dev/null +++ b/src/zhu/ZhuceIndex.vue @@ -0,0 +1,83 @@ + + + + +