基于javaweb+springboot的宠物医院预约管理系统设计和实现(java+springboot+mysql+ssm)
项目使用java SpringMVC、springboot mybatis、layui为核心技术编写
首页登录有可爱的小猫咪:
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
@RequestMapping("/tjApply")
public String tjApply(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
Appointment appointment = new Appointment();
appointment.setUserId(user.getId());
appointment.setPage(1);
appointment.setLimit(99999);
MMGridPageVoBean voBean = (MMGridPageVoBean) appointmentService.getAllByLimit(appointment);
List rows = voBean.getRows();
Integer a1 = 0;
Integer a2 = 0;
Integer a3 = 0;
Integer a4 = 0;
for (Appointment a: rows){
switch (a.getStatus()){
case 1: a1++;break;
Listtime = new ArrayList<>(); List value = new ArrayList<>(); for (Map m : map){ String df = (String) m.get("df"); time.add(df+"点"); Long v = (Long) m.get("c"); if (v == null) { value.add(0L); }else { value.add(v); } } result.put("t", time); result.put("v", value); return result; } } 监控标准医生和用户: @Controller("UserStandardController") @RequestMapping("/user/standard") public class UserStandardController {
*/
@RequestMapping(value = "/add")
public String add(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
Pet pet = new Pet();
pet.setUserId(user.getId());
pet.setPage(1);
pet.setLimit(100);
MMGridPageVoBean voBean = (MMGridPageVoBean) petService.getAllByLimit(pet);
List rows = voBean.getRows();
MMGridPageVoBeanas = (MMGridPageVoBean ) appointmentService.getAllByLimit(appointment); applyCount.add(as==null? 0L : as.getTotal()); // 获取就诊记录 Diagnosis diagnosis = new Diagnosis(); diagnosis.setPetId(p.getId()); diagnosis.setPage(1); diagnosis.setLimit(10); MMGridPageVoBean ds = (MMGridPageVoBean ) diagnosisService.getAllByLimit(diagnosis); List dsRows = ds.getRows(); int diagnosisStatus = 0; for (Diagnosis d: dsRows){
}
}
宠物日志业务操作:
@Controller("UserPetDailyController")
@RequestMapping("/user/petDaily")
public class UserPetDailyController {
@Autowired
private final ResultMap resultMap;
@Autowired
private UserService userService;
@Autowired
private UserRoleService userRoleService;
@Autowired
public UserController(ResultMap resultMap) {
this.resultMap = resultMap;
}
@RequestMapping(value = "/getMessage", method = RequestMethod.GET)
public ResultMap getMessage() {
return resultMap.success().message("您拥有用户权限,可以获得该接口的信息!");
}
@RequestMapping(value = "/editUserPage")
MMGridPageVoBeanvoBean = (MMGridPageVoBean ) petService.getAllByLimit(pet); List rows = voBean.getRows(); model.addAttribute("pets", rows); if (rows.size()>0){ pet = rows.get(0); PetDaily daily = new PetDaily(); daily.setPetId(pet.getId()); daily.setPage(1); daily.setLimit(99999); MMGridPageVoBean ppp = (MMGridPageVoBean ) petDailyService.getAllByLimit(daily); List list = ppp.getRows(); for (PetDaily p : list){ p.setDateTime(MyUtils.getDate2String(p.getCreateTime(), "yyyy-MM-dd")); } model.addAttribute("dailys", list); } return "tj/tjDailyDoctor";
int sw = diagnosisStatus / dsRows.size();
switch (sw){
case 1:dsCount.add(p.getName() + " 宠物健康,请继续保持");break;
case 2:dsCount.add(p.getName() + " 宠物异常请及时就诊!");break;
case 3:dsCount.add(p.getName() + " 宠物病情比较严重,请及时就医!");break;
case 4:dsCount.add(p.getName() + " 很抱歉宠物已无法治疗!");break;
default:dsCount.add(p.getName() + " 宠物基本健康,请继续保持");break;
}
// 获取宠物日志
PetDaily petDaily = new PetDaily();
petDaily.setPetId(p.getId());
petDaily.setPage(1);
petDaily.setLimit(10);
MMGridPageVoBean ps = (MMGridPageVoBean) petDailyService.getAllByLimit(petDaily);
List psRows = ps.getRows();
double t = 0;
switch (a.getStatus()){
case 1: a1++;break;
case 2: a2++;break;
case 3: a3++;break;
case 4: a4++;break;
}
}
model.addAttribute("a1", a1);
model.addAttribute("a2", a2);
model.addAttribute("a3", a3);
model.addAttribute("a4", a4);
return "tj/tjApply";
}
standard.setAgeMax(petAge);
standard.setPage(1);
standard.setLimit(100);
MMGridPageVoBean ss = (MMGridPageVoBean) standardService.getAllByLimit(standard);
List ssRows = ss.getRows();
double tsMin = 0;
double tsMax = 0;
double wsMin = 0;
double wsMax = 0;
double hsMin = 0;
double hsMax = 0;
double asMin = 0;
double asMax = 0;
for (Standard s : ssRows){
tsMin+=s.getTempMin();
tsMax+=s.getTempMax();
wsMin+=s.getWeightMin();
wsMax+=s.getWeightMax();
hsMin+=s.getHeightMin();
hsMax+=s.getHeightMax();
asMin+=s.getAppetiteMin();
asMax+=s.getAppetiteMax();
}
tsMin = tsMin / ssRows.size();
@RequestMapping(value = "/add")
public String add(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
Pet pet = new Pet();
pet.setUserId(user.getId());
pet.setPage(1);
pet.setLimit(100);
MMGridPageVoBean voBean = (MMGridPageVoBean) petService.getAllByLimit(pet);
List rows = voBean.getRows();
// 获取到该用户下所有的宠物
model.addAttribute("pets", rows);
return "user/petDailyAdd";
}
@RequestMapping(value = "/add")
public String add() {
return "user/standardAdd";
}
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Standard pojo) {
try {
standardService.add(pojo);
*/
@RequestMapping("/assess")
public String applyListDoctor(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
Pet pet = new Pet();
pet.setUserId(user.getId());
pet.setPage(1);
pet.setLimit(100);
MMGridPageVoBean voBean = (MMGridPageVoBean) petService.getAllByLimit(pet);
List rows = voBean.getRows();
// 获取到该用户下所有的宠物
model.addAttribute("pets", rows);
List applyCount = new ArrayList<>();
List dsCount = new ArrayList<>();
List tsCount = new ArrayList<>();
List wsCount = new ArrayList<>();
List hsCount = new ArrayList<>();
List asCount = new ArrayList<>();
List pt = new ArrayList<>();
List pw = new ArrayList<>();
List ph = new ArrayList<>();
*/
@RequestMapping("/tjDailyDataDoctor")
@ResponseBody
public Object tjDailyDataDoctor(Long id){
PetDaily daily = new PetDaily();
daily.setPetId(id);
daily.setPage(1);
daily.setLimit(99999);
MMGridPageVoBean ppp = (MMGridPageVoBean) petDailyService.getAllByLimit(daily);
List list = ppp.getRows();
for (PetDaily p : list){
p.setDateTime(MyUtils.getDate2String(p.getCreateTime(), "yyyy-MM-dd"));
}
return list;
}
@RequestMapping(value = "/freeTime")
public String freeTime(Model model) {
List doctors = userService.listDoctor();
model.addAttribute("doctors", doctors);
Long docId = doctors.get(0).getId();
* 普通用户页面user/standardList.html
*/
@RequestMapping("/standardList")
public String standardList() {
return "user/standardList";
}
@RequestMapping("/getAllByLimit")
@ResponseBody
public Object getAllByLimit(Standard pojo) {
return standardService.getAllByLimit(pojo);
}
@RequestMapping("/getAllByLimitDoctor")
@ResponseBody
public Object getAllByLimitBaoJie(Standard pojo) {
private StandardService standardService;
@RequestMapping("/assess")
public String applyListDoctor(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
Pet pet = new Pet();
pet.setUserId(user.getId());
pet.setPage(1);
pet.setLimit(100);
MMGridPageVoBean voBean = (MMGridPageVoBean) petService.getAllByLimit(pet);
List rows = voBean.getRows();
// 获取到该用户下所有的宠物
model.addAttribute("pets", rows);
List applyCount = new ArrayList<>();
List dsCount = new ArrayList<>();
List tsCount = new ArrayList<>();
List wsCount = new ArrayList<>();
List hsCount = new ArrayList<>();
List asCount = new ArrayList<>();
List pt = new ArrayList<>();
List pw = new ArrayList<>();
return "ERROR";
}
}
@RequestMapping(value = "/add")
public String add() {
return "user/standardAdd";
}
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Standard pojo) {
try {
standardService.add(pojo);
return "SUCCESS";
} catch (Exception e) {
pet.setUserId(user.getId());
pet.setPage(1);
pet.setLimit(100);
MMGridPageVoBean voBean = (MMGridPageVoBean) petService.getAllByLimit(pet);
List rows = voBean.getRows();
// 获取到该用户下所有的宠物
model.addAttribute("pets", rows);
List applyCount = new ArrayList<>();
List dsCount = new ArrayList<>();
List tsCount = new ArrayList<>();
List wsCount = new ArrayList<>();
List hsCount = new ArrayList<>();
List asCount = new ArrayList<>();
List pt = new ArrayList<>();
List pw = new ArrayList<>();
List ph = new ArrayList<>();
List pa = new ArrayList<>();
List mt = new ArrayList<>();
List mw = new ArrayList<>();
List mh = new ArrayList<>();
List ma = new ArrayList<>();
for(Pet p: rows){
// 获取预约次数
Appointment appointment = new Appointment();
private UserService userService;
@Autowired
private UserRoleService userRoleService;
@Autowired
public UserController(ResultMap resultMap) {
this.resultMap = resultMap;
}
@RequestMapping(value = "/getMessage", method = RequestMethod.GET)
*/
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(PetDaily pojo) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
pojo.setUserId(user.getId());
pojo.setCreateTime(new Date());
petDailyService.add(pojo);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackonly();
return "ERROR";
}
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Standard pojo) {
try {
standardService.add(pojo);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackonly();
return "ERROR";
}
}
}
宠物日志业务操作:
}
@RequestMapping("/getAllByLimit")
@ResponseBody
public Object getAllByLimit(PetDaily pojo) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
pojo.setUserId(user.getId());
return petDailyService.getAllByLimit(pojo);
}
@RequestMapping("/getAllByLimitDoctor")
@ResponseBody
public Object getAllByLimitDoctor(PetDaily pojo) {
return petDailyService.getAllByLimit(pojo);
}
TransactionAspectSupport.currentTransactionStatus().setRollbackonly();
return "ERROR";
}
}
@RequestMapping(value = "/add")
public String add() {
return "user/standardAdd";
}
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Standard pojo) {
try {
}
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(PetDaily pojo) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
pojo.setUserId(user.getId());
pojo.setCreateTime(new Date());
petDailyService.add(pojo);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackonly();
return "ERROR";
}
}
}
* 根据id删除
*/
@RequestMapping(value = "/del")
@ResponseBody
@Transactional
public String del(Long id) {
try {
standardService.deleteById(id);
return "SUCCESS";
} catch (Exception e) {
logger.error("删除异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackonly();
return "ERROR";
}
}
@RequestMapping("/getAllByLimit")
@ResponseBody
public Object getAllByLimit(Standard pojo) {
return standardService.getAllByLimit(pojo);
}
@RequestMapping("/getAllByLimitDoctor")
@ResponseBody
public Object getAllByLimitBaoJie(Standard pojo) {
return standardService.getAllByLimit(pojo);
}
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(PetDaily pojo) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@RequestMapping("/standardListDoctor")
public String standardListDoctor() {
return "user/standardListDoctor";
}
@RequestMapping("/standardList")
public String standardList() {
return "user/standardList";
}
@RequestMapping("/getAllByLimit")
@ResponseBody



