赞
踩
基于javaweb+mysql的springboot宠物医院管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot宠物医院管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
一、项目简述
功能描叙: 医生信息,客户信息,宠物管理,浏览管理,诊断管理, 医生管理,用户管理等等模块。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Springboot+ SpringMVC + MyBatis + ThymeLeaf + HTML+ JavaScript + JQuery + Ajax + maven等等
@RestController public class Forest_PetsController { //使用map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //映射 @Autowired private Forest_PetsService forest_PetsService; @Autowired private Forest_Customer_PetsService forest_customer_petsService; @Autowired private Forest_HistoryRecordService forest_historyRecordService; /** * insertSelective * 首次加载页面 */ @PostMapping("/ForestPetsEntitySelect") public Map<String, Object> ForestPetsEntitySelect(@RequestBody Forest_PetsEntity model, HttpServletRequest request) { //求出统计的数据 num = count(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值
//新增数据 @PostMapping("/ForestDiagnosisEntityRegister") public Map<String,Object> ForestDiagnosisEntityRegister(@RequestBody Forest_DiagnosisEntity model){ //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 model.setForest_Diagnosis_Time(sf.format(d)); //联合查询 获取动物编号 Forest_Customer_PetsEntity f=new Forest_Customer_PetsEntity(); f.setForest_Customer_ID(model.getForest_Customer_ID()); List<Forest_Customer_PetsEntity> list=forest_customer_petsService.ForestCustomerPetsEntitySearchCustomerAll(f); model.setForest_Pets_ID(list.get(0).getForest_Pets_ID()); //新增数据 int register=forest_diagnosisService.ForestDiagnosisEntityRegister(model); if(register==1){ map.put("code",200); return map; } map.put("code",500); return map; } //编号详情 @PostMapping("/ForestDiagnosisEntityID") public Map<String, Object> ForestDiagnosisEntityID(@RequestBody Forest_DiagnosisEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } List<Forest_DiagnosisEntity> list = forest_diagnosisService.ForestDiagnosisEntityID(model); //存储的数据 map.put("diagnosis", list); //状态码 200 map.put("code", 200); return map; } //更改数据 @PostMapping("/ForestDiagnosisEntityUpdate") public Map<String, Object> ForestDiagnosisEntityUpdate(@RequestBody Forest_DiagnosisEntity model) { //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 model.setForest_Diagnosis_Time(sf.format(d)); int list = forest_diagnosisService.ForestDiagnosisEntityUpdate(model); if(list==1){
@RestController public class Forest_userCongtroller { //map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //service层的映射 @Autowired Forest_userService forest_userService; //全局访问类 private Forest_variable Forest_variable = new Forest_variable(); //存储数据 private List<Forest_userEntity> list; //登录 @PostMapping("/login") public Map<String,Object> login(@RequestBody Forest_userEntity forest_userEntity, HttpSession session){ //用户登录 forest_userEntity.setForest_User_Grade(1); forest_userEntity.setForest_User_State(1); list=forest_userService.ForestUserEntityLogin(forest_userEntity); if(list.size()==0){ map.put("code",500); return map; } forest_userEntity.setForest_User_ID(list.get(0).getForest_User_ID()); //使用全局变量存储 将编号 和 登录名存储到session中 session.setAttribute("num", 1); Forest_variable.variableName(session, forest_userEntity); map.put("code",200); return map; } //管理登录 @PostMapping("/UserLogin") public Map<String,Object> UserLogin(@RequestBody Forest_userEntity forest_userEntity, HttpSession session){ //用户登录 forest_userEntity.setForest_User_Grade(2); forest_userEntity.setForest_User_State(1);
@RestController public class Forest_userCongtroller { //map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //service层的映射 @Autowired Forest_userService forest_userService; //全局访问类 private Forest_variable Forest_variable = new Forest_variable(); //存储数据 private List<Forest_userEntity> list; //登录 @PostMapping("/login") public Map<String,Object> login(@RequestBody Forest_userEntity forest_userEntity, HttpSession session){ //用户登录 forest_userEntity.setForest_User_Grade(1); forest_userEntity.setForest_User_State(1); list=forest_userService.ForestUserEntityLogin(forest_userEntity); if(list.size()==0){ map.put("code",500); return map; } forest_userEntity.setForest_User_ID(list.get(0).getForest_User_ID()); //使用全局变量存储 将编号 和 登录名存储到session中 session.setAttribute("num", 1); Forest_variable.variableName(session, forest_userEntity); map.put("code",200);
//更改数据 @PostMapping("/ForestVetDoctorEntityUpdateAll") public Map<String, Object> ForestVetDoctorEntityUpdateAll(@RequestBody Forest_VetDoctorEntity model) { //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 model.setForest_VetDoctor_Time(sf.format(d)); int list = forest_vetDoctorService.ForestVetDoctorEntityUpdateAll(model); if(list==1){ map.put("code", 200); return map; } //状态码 200 map.put("code", 400); return map; } //编号详情 @PostMapping("/ForestVetDoctorEntityState") public Map<String, Object> ForestVetDoctorEntityState(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } int list = forest_vetDoctorService.ForestVetDoctorEntityState(model); if(list==1){ map.put("code", 200); return map; } //状态码 200 map.put("code", 400); return map; } /** * insertSelective * 首次加载页面 */ @RequestMapping("/ForestVetDoctorEntitySelect1") public Map<String, Object> insertSelective1(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //求出统计的数据 num = count2(model); System.out.println("dfgdfgfdgfdgfdgfdgfdgfd"); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值
@RestController public class Forest_fileUploadController { Forest_PetsEntity forest_petsEntity = new Forest_PetsEntity(); Forest_VetDoctorEntity forest_vetDoctorEntity = new Forest_VetDoctorEntity(); @Autowired Forest_PetsService forest_petsService; @Autowired Forest_VetDoctorService forest_vetDoctorService; /** * 将图片存在对应文件中 宠物 */ @RequestMapping("upload") public Map fileUpload(@RequestParam MultipartFile file, String Forest_Pets_ID, HttpServletRequest request) { Map map = new HashMap(); boolean rs = false; if (!file.isEmpty()) { String fileName = System.currentTimeMillis() + file.getOriginalFilename(); forest_petsEntity.setForest_Pets_ID(Integer.parseInt(Forest_Pets_ID)); forest_petsEntity.setForest_Pets_Photo(fileName); forest_petsService.ForestPetsEntityUpdate(forest_petsEntity); String savePath = WebMvcConfig.uploadImagePath; File dest = new File(savePath + File.separator + fileName); try { file.transferTo(dest); rs = true; map.put("result", rs); } catch (IOException e) { e.printStackTrace(); map.put("result", rs); } } else if (file.isEmpty()) { map.put("result", rs); } return map; } /** * 将图片存在对应文件中 宠物 */ @RequestMapping("uploadAdministrator") public Map uploadAdministrator(@RequestParam MultipartFile file, String Forest_VetDoctor_ID, HttpServletRequest request) { Map map = new HashMap(); boolean rs = false; if (!file.isEmpty()) { String fileName = System.currentTimeMillis() + file.getOriginalFilename(); forest_vetDoctorEntity.setForest_VetDoctor_ID(Integer.parseInt(Forest_VetDoctor_ID)); forest_vetDoctorEntity.setForest_VetDoctor_Image(fileName); forest_vetDoctorService.ForestVetDoctorEntityUpdate(forest_vetDoctorEntity); String savePath = WebMvcConfig.uploadImagePath; File dest = new File(savePath + File.separator + fileName); try {
//若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySelect1(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("doctor", list); //存储页数1 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count2(Forest_VetDoctorEntity model) { //查询的统计数据 count = forest_vetDoctorService.ForestVetDoctorEntityRow1(); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @RequestMapping("/ForestVetDoctorEntitySearch1") public Map<String, Object> ForestVetDoctorEntitySearch1(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //求出统计的数据 num = count11(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); }
@PostMapping("/ForestVetDoctorEntityID") public Map<String, Object> ForestVetDoctorEntityID(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntityID(model); //存储的数据 map.put("doctor", list); //状态码 200 map.put("code", 200); return map; } //更改数据 @PostMapping("/ForestVetDoctorEntityUpdateAll") public Map<String, Object> ForestVetDoctorEntityUpdateAll(@RequestBody Forest_VetDoctorEntity model) { //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 model.setForest_VetDoctor_Time(sf.format(d)); int list = forest_vetDoctorService.ForestVetDoctorEntityUpdateAll(model); if(list==1){ map.put("code", 200); return map; } //状态码 200 map.put("code", 400); return map; } //编号详情 @PostMapping("/ForestVetDoctorEntityState") public Map<String, Object> ForestVetDoctorEntityState(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } int list = forest_vetDoctorService.ForestVetDoctorEntityState(model); if(list==1){ map.put("code", 200); return map; } //状态码 200 map.put("code", 400); return map; } /**
@PostMapping("/ForestUserEntityState") public Map<String, Object> ForestUserEntityState(@RequestBody Forest_userEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } int list = forest_userService.ForestUserEntityState(model); if(list==1){ map.put("code", 200); return map; } //状态码 200 map.put("code", 400); return map; } } package com.forest.demo.Controller; @RestController public class Forest_PetsController { //使用map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值
if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //新增数据 @PostMapping("/ForestPetsEntityRegister") public Map<String,Object> ForestPetsEntityRegister(@RequestBody Forest_PetsEntity forest_PetsEntity){ //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 forest_PetsEntity.setForest_Pets_Time(sf.format(d)); int register=forest_PetsService.ForestPetsEntityRegister(forest_PetsEntity); forest_PetsEntity.setNum(0); forest_PetsEntity.setSize(20); List<Forest_PetsEntity> list = forest_PetsService.ForestPetsEntitySelect(forest_PetsEntity); Forest_Customer_PetsEntity f=new Forest_Customer_PetsEntity(); f.setForest_Customer_ID(forest_PetsEntity.getForest_Customer_ID()); f.setForest_Pets_ID(list.get(0).getForest_Pets_ID()); f.setForest_Customer_Pets_Time(sf.format(d)); int forestRegister=forest_customer_petsService.ForestCustomerPetsEntityAdd(f); if(register==1&&forestRegister==1){ map.put("code",200); return map; } map.put("code",500); return map; } //编号详情
List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySearch1(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("doctor", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count11(Forest_VetDoctorEntity model) { //查询的统计数据 count = forest_vetDoctorService.ForestVetDoctorEntitySearchRow1(model); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } } package com.forest.demo.Controller;
@RestController public class Forest_VetDoctorController { //使用map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //映射 @Autowired private Forest_VetDoctorService forest_vetDoctorService; /** * insertSelective * 首次加载页面 */ @RequestMapping("/ForestVetDoctorEntitySelect") public Map<String, Object> insertSelective(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request, HttpSession session) { //求出统计的数据 num = count(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } String nums = String.valueOf(session.getAttribute("num")); int tt = Integer.parseInt(nums); if (tt != 2 ) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySelect(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("doctor", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; }
map.put("code", 500); return map; } List<Forest_VetDoctorEntity> list = forest_vetDoctorService.Forest_VetDoctorEntityDetails(model); //存储的数据 map.put("doctor", list); //状态码 200 map.put("code", 200); return map; } //新增数据 @PostMapping("/ForestVetDoctorEntityRegister") public Map<String,Object> ForestVetDoctorEntityRegister(@RequestBody Forest_VetDoctorEntity forest_vetDoctorEntity){ //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 forest_vetDoctorEntity.setForest_VetDoctor_Time(sf.format(d)); forest_vetDoctorEntity.setForest_VetDoctor_Detail("生活上:活泼开朗、乐观上进、待人热情,可以和老师、同学友好相处。\n" + "学习上:能吃苦耐劳,用于承受压力,勇于创新。\n" + "工作上:担任项目助理一职,对待工作认真负责,善于沟通、喜欢积极地去帮助同学,有较强的抗压能力"); int register=forest_vetDoctorService.ForestVetDoctorEntityRegister(forest_vetDoctorEntity); if(register==1){ map.put("code",200); return map; } map.put("code",500); return map; } //编号详情 @PostMapping("/ForestVetDoctorEntityID") public Map<String, Object> ForestVetDoctorEntityID(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntityID(model); //存储的数据 map.put("doctor", list); //状态码 200 map.put("code", 200); return map; } //更改数据 @PostMapping("/ForestVetDoctorEntityUpdateAll") public Map<String, Object> ForestVetDoctorEntityUpdateAll(@RequestBody Forest_VetDoctorEntity model) { //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@RestController public class Forest_DiagnosisController { //使用map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //映射 @Autowired private Forest_DiagnosisService forest_diagnosisService; @Autowired private Forest_Customer_PetsService forest_customer_petsService; /** * insertSelective * 首次加载页面 */ @PostMapping("/ForestDiagnosisEntitySelect") public Map<String, Object> ForestDiagnosisEntitySelect(@RequestBody Forest_DiagnosisEntity model, HttpServletRequest request) { //求出统计的数据 num = count(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_DiagnosisEntity> list = forest_diagnosisService.ForestDiagnosisEntitySelect(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("diagnosis", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count(Forest_DiagnosisEntity model) { //查询的统计数据 count = forest_diagnosisService.ForestDiagnosisEntityRow(); //判断求出页数 if (count % model.getSize() == 0) {
//判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_userEntity> list = forest_userService.ForestUserEntitySelect(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("user", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count(Forest_userEntity model) { //查询的统计数据 count = forest_userService.ForestUserEntityRow(); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @PostMapping("/ForestUserEntitySearch") public Map<String, Object> ForestVetDoctorEntitySearch(@RequestBody Forest_userEntity model, HttpServletRequest request) { //求出统计的数据 num = count1(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) {
public int count11(Forest_VetDoctorEntity model) { //查询的统计数据 count = forest_vetDoctorService.ForestVetDoctorEntitySearchRow1(model); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } } package com.forest.demo.Controller; @RestController public class Forest_userCongtroller { //map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //service层的映射 @Autowired Forest_userService forest_userService; //全局访问类 private Forest_variable Forest_variable = new Forest_variable(); //存储数据 private List<Forest_userEntity> list; //登录 @PostMapping("/login") public Map<String,Object> login(@RequestBody Forest_userEntity forest_userEntity, HttpSession session){
//查询的统计数据 count = forest_customerService.ForestCustomerEntityRow(); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @RequestMapping("/ForestCustomerEntitySearch") public Map<String, Object> ForestCustomerEntitySearch(@RequestBody Forest_CustomerEntity model, HttpServletRequest request) { //求出统计的数据 num = count1(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_CustomerEntity> list = forest_customerService.ForestCustomerEntitySearch(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("customer", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count1(Forest_CustomerEntity model) { //查询的统计数据 count = forest_customerService.ForestCustomerEntitySearchRow(model); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize();
//判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @RequestMapping("/ForestVetDoctorEntitySearch1") public Map<String, Object> ForestVetDoctorEntitySearch1(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //求出统计的数据 num = count11(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySearch1(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("doctor", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count11(Forest_VetDoctorEntity model) { //查询的统计数据 count = forest_vetDoctorService.ForestVetDoctorEntitySearchRow1(model); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; }
if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } List<Forest_DiagnosisEntity> list = forest_diagnosisService.ForestDiagnosisEntityDetails(model); if(list.size()==0) { //状态码 200 map.put("code", 400); return map; } //存储的数据 map.put("diagnosis", list); //状态码 200 map.put("code", 200); return map; } //新增数据 @PostMapping("/ForestDiagnosisEntityRegister") public Map<String,Object> ForestDiagnosisEntityRegister(@RequestBody Forest_DiagnosisEntity model){ //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 model.setForest_Diagnosis_Time(sf.format(d)); //联合查询 获取动物编号 Forest_Customer_PetsEntity f=new Forest_Customer_PetsEntity(); f.setForest_Customer_ID(model.getForest_Customer_ID()); List<Forest_Customer_PetsEntity> list=forest_customer_petsService.ForestCustomerPetsEntitySearchCustomerAll(f); model.setForest_Pets_ID(list.get(0).getForest_Pets_ID()); //新增数据 int register=forest_diagnosisService.ForestDiagnosisEntityRegister(model); if(register==1){ map.put("code",200); return map; } map.put("code",500); return map; } //编号详情 @PostMapping("/ForestDiagnosisEntityID") public Map<String, Object> ForestDiagnosisEntityID(@RequestBody Forest_DiagnosisEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; }
*/ public int count(Forest_HistoryRecordEntity model) { //查询的统计数据 count = forest_historyRecordService.ForestUserPetsEntityRow(); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @PostMapping("/ForestUserPetsEntitySearch") public Map<String, Object> ForestUserPetsEntitySearch(@RequestBody Forest_HistoryRecordEntity model, HttpServletRequest request) { //求出统计的数据 num = count1(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_HistoryRecordEntity> list = forest_historyRecordService.ForestUserPetsEntitySearch(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("UserPet", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; }
map.put("customer", list); //状态码 200 map.put("code", 200); return map; } //新增数据 @PostMapping("/ForestCustomerEntityRegister") public Map<String,Object> ForestCustomerEntityRegister(@RequestBody Forest_CustomerEntity forest_customerEntity){ //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //获取时间的方法 Date d = new Date(); //将获取的时间转换成设置的时间格式进行存储 forest_customerEntity.setForest_Customer_Time(sf.format(d)); int register=forest_customerService.ForestCustomerEntityRegister(forest_customerEntity); if(register==1){ map.put("code",200); return map; } map.put("code",500); return map; } //编号详情 @PostMapping("/ForestCustomerEntityID") public Map<String, Object> ForestCustomerEntityID(@RequestBody Forest_CustomerEntity model, HttpServletRequest request) { //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } List<Forest_CustomerEntity> list = forest_customerService.ForestCustomerEntityID(model); //存储的数据 map.put("customer", list); //状态码 200 map.put("code", 200); return map; } //更改数据 @PostMapping("/ForestCustomerEntityUpdate") public Map<String, Object> ForestCustomerEntityUpdate(@RequestBody Forest_CustomerEntity model) { //设置时间的格式 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@RestController public class Forest_fileUploadController { Forest_PetsEntity forest_petsEntity = new Forest_PetsEntity(); Forest_VetDoctorEntity forest_vetDoctorEntity = new Forest_VetDoctorEntity(); @Autowired Forest_PetsService forest_petsService; @Autowired Forest_VetDoctorService forest_vetDoctorService; /** * 将图片存在对应文件中 宠物 */ @RequestMapping("upload") public Map fileUpload(@RequestParam MultipartFile file, String Forest_Pets_ID, HttpServletRequest request) { Map map = new HashMap(); boolean rs = false; if (!file.isEmpty()) { String fileName = System.currentTimeMillis() + file.getOriginalFilename(); forest_petsEntity.setForest_Pets_ID(Integer.parseInt(Forest_Pets_ID)); forest_petsEntity.setForest_Pets_Photo(fileName); forest_petsService.ForestPetsEntityUpdate(forest_petsEntity); String savePath = WebMvcConfig.uploadImagePath; File dest = new File(savePath + File.separator + fileName); try { file.transferTo(dest); rs = true; map.put("result", rs); } catch (IOException e) { e.printStackTrace(); map.put("result", rs); }
public int count(Forest_HistoryRecordEntity model) { //查询的统计数据 count = forest_historyRecordService.ForestUserPetsEntityRow(); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @PostMapping("/ForestUserPetsEntitySearch") public Map<String, Object> ForestUserPetsEntitySearch(@RequestBody Forest_HistoryRecordEntity model, HttpServletRequest request) { //求出统计的数据 num = count1(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_HistoryRecordEntity> list = forest_historyRecordService.ForestUserPetsEntitySearch(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("UserPet", list); //存储页数 map.put("num", num); //状态码 200
num = count / model.getSize(); } else { num = count / model.getSize() + 1; } //如果信息大于8页 只显示8页 if (num >= 8) { return 8; } return num; } //搜索数据 @RequestMapping("/ForestVetDoctorEntitySearch") public Map<String, Object> ForestVetDoctorEntitySearch(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) { //求出统计的数据 num = count1(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySearch(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("doctor", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count1(Forest_VetDoctorEntity model) { //查询的统计数据 count = forest_vetDoctorService.ForestVetDoctorEntitySearchRow(model);
@PostMapping("/ForestPetsEntitySelect") public Map<String, Object> ForestPetsEntitySelect(@RequestBody Forest_PetsEntity model, HttpServletRequest request) { //求出统计的数据 num = count(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) { //若不是首页,则获取起始值 int ss = model.getNum() * model.getSize(); //存储起始值 model.setNum(ss); } //查询的起始页 List<Forest_PetsEntity> list = forest_PetsService.ForestPetsEntitySelect(model); //存储xiaoc的登录名 map.put("name", new Forest_variable().sessionName(request)); //存储的数据 map.put("Pets", list); //存储页数 map.put("num", num); //状态码 200 map.put("code", 200); return map; } /** * 求出统计的数据 */ public int count(Forest_PetsEntity model) { //查询的统计数据 count = forest_PetsService.ForestPetsEntityRow(); //判断求出页数 if (count % model.getSize() == 0) { num = count / model.getSize(); } else { num = count / model.getSize() + 1;
} package com.forest.demo.Controller; @RestController public class Forest_HistoryRecordController { //使用map存储数据 private Map<String, Object> map = new HashMap<>(); //数据页数和起始值 private int count, num; //映射 @Autowired private Forest_HistoryRecordService forest_historyRecordService; /** * insertSelective * 首次加载页面 */ @PostMapping("/ForestUserPetsEntitySelect") public Map<String, Object> ForestUserPetsEntitySelect(@RequestBody Forest_HistoryRecordEntity model, HttpServletRequest request) { //求出统计的数据 num = count(model); //判断是否登录 if (new Forest_variable().variableNameSession(request) == 500) { map.put("code", 500); return map; } //判断是否是首页 if (model.getNum() != 0) {
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。