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 0000000..f3d2503 Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/controller/DoctorController.java b/src/controller/DoctorController.java new file mode 100644 index 0000000..8c8e811 --- /dev/null +++ b/src/controller/DoctorController.java @@ -0,0 +1,20 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Doctor; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DoctorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +public class DoctorController { + @Autowired + DoctorService doctorService; + + @CrossOrigin + @GetMapping("/api/register") + public List 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 @@ + + + + +