feige
2024-06-22 1250a22d42e2cd89c11e38aa2ff45ce00f7aaba0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfPetNoteController.java
@@ -53,19 +53,21 @@
     * 根据宠物id获取相关备忘录
     */
    @GetMapping
    public AjaxResult getByPetId(@PathParam("pid")Long pid){
        return zfPetNoteService.getAllPetNoteByPetId(pid);
    public AjaxResult getByPetId(@PathParam("pid")String pid,ZfPetNote zfPetNote){
        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfPetNoteService.getAllPetNoteByPetId(pageNum,pageSize,pid,zfPetNote);
    }
    /**
     * 获取导入模板
     */
    @GetMapping("/model")
    @PostMapping("/model")
    public void getExportModel(HttpServletResponse response){
        List<ZfPetNote> list = Collections.singletonList(new ZfPetNote());
        ExcelUtil<ZfPetNote> util = new ExcelUtil<>(ZfPetNote.class);
        util.exportExcel(response,list,"魅宠备忘录记录数据");
        util.exportExcel(response,list,"魅宠备忘录导入模板");
    }
@@ -83,12 +85,23 @@
        util.exportExcel(response, list, "魅宠备忘录记录数据");
    }
    @Log(title = "魅宠备忘录记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export1/{ids}")
    public void export1(HttpServletResponse response, ZfPetNote zfPetNote, @PathVariable Long[] ids)
    {
        List<ZfPetNote> list = zfPetNoteService.selectByIds(ids);
        log.info("导出记录为:{}",list);
        ExcelUtil<ZfPetNote> util = new ExcelUtil<>(ZfPetNote.class);
        util.exportExcel(response, list, "魅宠备忘录记录数据");
    }
    /**
     * 导入魅宠备忘录记录列表
     */
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @PostMapping("/importData/{pid}")
    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file,@PathVariable Long pid) throws Exception
    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file,@PathVariable String pid) throws Exception
    {
        ExcelUtil<ZfPetNote> util = new ExcelUtil<>(ZfPetNote.class);
        List<ZfPetNote> eventList = util.importExcel(file.getInputStream());