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?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 @@ + ++ ++ ++ ++ ++ ++ ++ + + + + +注册新用户
++ ++ ++ + ++ + ++ + ++ + +确定 +