栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 软件开发 > 后端开发 > Java

基于javaweb+springboot的宠物医院预约管理系统设计和实现(java+springboot+mysql+ssm)

Java 更新时间:发布时间: 百科书网 趣学号

项目使用java SpringMVC、springboot mybatis、layui为核心技术编写

首页登录有可爱的小猫咪:




适用

课程设计,大作业,毕业设计,项目练习,学习演示等

        List mw = new ArrayList<>();
        List mh = new ArrayList<>();
        List ma = new ArrayList<>();
        for(Pet p: rows){
            // 获取预约次数
            Appointment appointment = new Appointment();
            appointment.setPetId(p.getId());
            appointment.setPage(1);
            appointment.setLimit(1000);
            MMGridPageVoBean  as = (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){
                diagnosisStatus += d.getStatus();
            }
            int sw = diagnosisStatus / dsRows.size();
            switch (sw){
                case 1:dsCount.add(p.getName() + "  宠物健康,请继续保持");break;
        try {
            petDailyService.deleteById(id);
            return "SUCCESS";
        } catch (Exception e) {
            logger.error("删除异常", e);
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return "ERROR";
        }
    }
    
    @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";
    }
                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;
            double w = 0;
            double h = 0;
            double a = 0;
            for (PetDaily petDaily1 : psRows){
                t+=petDaily1.getTemperature();
                w+=petDaily1.getWeight();
                h+=petDaily1.getHeight();
                a+=petDaily1.getAppetite();
            }
            t = t/psRows.size();
            w = w/psRows.size();
            h = h/psRows.size();
            a = a/psRows.size();
            pt.add(t);
        }else {
            model.addAttribute("petId", "petId");
        }
        return "user/petDailyList";
    }
    
    @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("/getAllByLimit")
    @ResponseBody
    public Object getAllByLimit(PetDaily pojo) {
        Subject subject = SecurityUtils.getSubject();
        User user = (User) subject.getPrincipal();
        pojo.setUserId(user.getId());
        return petDailyService.getAllByLimit(pojo);
    }
    

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/888978.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号