Jinquan_Ou
2023-04-03 1dfe61fdf1b36061871ead5337172801e64df201
魅宠、家庭小医生1.0
17个文件已修改
1218 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfMasterController.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfPetController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfPetNoteController.java 183 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/test/java/com/ruoyi/insertData.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/ZfDoctor.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/ZfMaster.java 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/ZfPet.java 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/ZfPetNote.java 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfMasterService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfPetNoteService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfPetService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfMasterServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetNoteServiceImpl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorController.java
@@ -1,9 +1,26 @@
package com.ruoyi.web.controller.zhang;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.service.ZfDoctorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
/**
 * <p>
@@ -14,8 +31,93 @@
 * @since 2023-03-12
 */
@RestController
@Slf4j
@RequestMapping("/zfDoctor")
public class ZfDoctorController {
public class ZfDoctorController extends BaseController {
    @Resource
    private ZfDoctorService zfDoctorService;
    @GetMapping("/all")
    public AjaxResult listAll(ZfDoctor zfDoctor){
        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfDoctorService.selectDoctorList(zfDoctor, pageNum, pageSize);
    }
    /**
     * 导出家庭小医生记录列表
     */
//    @PreAuthorize("@ss.hasPermi('system:property:export')")
    @Log(title = "家庭小医生记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZfDoctor zfDoctor)
    {
        List<ZfDoctor> list = zfDoctorService.selectByCondition(zfDoctor);
        log.info("导出记录为:{}",list);
        ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class);
        util.exportExcel(response, list, "家庭小医生记录数据");
    }
    /**
     * 导入家庭小医生记录列表
     */
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @PostMapping("/importData")
    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
    {
        ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class);
        List<ZfDoctor> eventList = util.importExcel(file.getInputStream());
        log.info("家庭小医生列表为:{}",eventList);
        if (zfDoctorService.saveBatch(eventList)) {
            return AjaxResult.success("导入数据成功");
        }
        return AjaxResult.error("导入数据失败");
    }
    /**
     * 获取家庭小医生记录详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:property:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zfDoctorService.getById(id));
    }
//
    /**
     * 新增家庭小医生记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:add')")
    @Log(title = "家庭小医生记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZfDoctor zfDoctor)
    {
        return toAjax(zfDoctorService.save(zfDoctor));
    }
    /**
     * 修改家庭小医生记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:edit')")
    @Log(title = "家庭小医生记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZfDoctor zfDoctor)
    {
        return toAjax(zfDoctorService.updateById(zfDoctor));
    }
//
    /**
     * 批量删除家庭小医生记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:remove')")
    @Log(title = "家庭小医生记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zfDoctorService.removeByIds(Arrays.asList(ids)));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfMasterController.java
@@ -1,9 +1,27 @@
package com.ruoyi.web.controller.zhang;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZfMaster;
import com.ruoyi.service.ZfMasterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.util.Arrays;
import java.util.List;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
/**
 * <p>
@@ -15,7 +33,101 @@
 */
@RestController
@RequestMapping("/zfMaster")
public class ZfMasterController {
@Slf4j
public class ZfMasterController extends BaseController {
    @Resource
    private ZfMasterService zfMasterService;
//    @GetMapping("/all")
//    public AjaxResult listAll(ZfMaster zfMaster){
//        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
//        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
//        return zfMasterService.selectPetNoteList(zfMaster, pageNum, pageSize);
//    }
    /**
     * 根据宠物id获取相关主人信息
     */
    @GetMapping()
    public AjaxResult getByPetId(@PathParam("pid")Long pid){
        return zfMasterService.getMasterInfoByPetId(pid);
    }
    /**
     * 导出魅宠主人信息记录列表
     */
//    @PreAuthorize("@ss.hasPermi('system:property:export')")
    @Log(title = "魅宠主人信息记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZfMaster zfMaster)
    {
        List<ZfMaster> list = zfMasterService.selectByCondition(zfMaster);
        log.info("导出记录为:{}",list);
        ExcelUtil<ZfMaster> util = new ExcelUtil<>(ZfMaster.class);
        util.exportExcel(response, list, "魅宠主人信息记录数据");
    }
    /**
     * 导入魅宠主人信息记录列表
     */
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @PostMapping("/importData")
    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
    {
        ExcelUtil<ZfMaster> util = new ExcelUtil<>(ZfMaster.class);
        List<ZfMaster> eventList = util.importExcel(file.getInputStream());
        log.info("魅宠主人信息列表为:{}",eventList);
        if (zfMasterService.saveBatch(eventList)) {
            return AjaxResult.success("导入数据成功");
        }
        return AjaxResult.error("导入数据失败");
    }
    /**
     * 获取魅宠主人信息记录详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:property:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zfMasterService.getById(id));
    }
//
    /**
     * 新增魅宠主人信息记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:add')")
    @Log(title = "魅宠主人信息记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZfMaster zfMaster)
    {
        return toAjax(zfMasterService.save(zfMaster));
    }
    /**
     * 修改魅宠主人信息记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:edit')")
    @Log(title = "魅宠主人信息记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZfMaster zfMaster)
    {
        return toAjax(zfMasterService.updateById(zfMaster));
    }
//
    /**
     * 批量删除魅宠主人信息记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:remove')")
    @Log(title = "魅宠主人信息记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zfMasterService.removeByIds(Arrays.asList(ids)));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfPetController.java
@@ -1,9 +1,26 @@
package com.ruoyi.web.controller.zhang;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZfPet;
import com.ruoyi.service.ZfPetService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
/**
 * <p>
@@ -15,7 +32,92 @@
 */
@RestController
@RequestMapping("/zfPet")
public class ZfPetController {
@Slf4j
public class ZfPetController extends BaseController {
    @Resource
    private ZfPetService zfPetService;
    @GetMapping("/all")
    public AjaxResult listAll(ZfPet zfPet){
        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfPetService.selectPetList(zfPet, pageNum, pageSize);
    }
    /**
     * 导出魅宠记录列表
     */
//    @PreAuthorize("@ss.hasPermi('system:property:export')")
    @Log(title = "魅宠记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZfPet zfPet)
    {
        List<ZfPet> list = zfPetService.selectByCondition(zfPet);
        log.info("导出记录为:{}",list);
        ExcelUtil<ZfPet> util = new ExcelUtil<>(ZfPet.class);
        util.exportExcel(response, list, "魅宠记录数据");
    }
    /**
     * 导入魅宠记录列表
     */
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @PostMapping("/importData")
    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
    {
        ExcelUtil<ZfPet> util = new ExcelUtil<>(ZfPet.class);
        List<ZfPet> eventList = util.importExcel(file.getInputStream());
        log.info("魅宠列表为:{}",eventList);
        if (zfPetService.saveBatch(eventList)) {
            return AjaxResult.success("导入数据成功");
        }
        return AjaxResult.error("导入数据失败");
    }
    /**
     * 获取魅宠记录详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:property:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zfPetService.getById(id));
    }
//
    /**
     * 新增魅宠记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:add')")
    @Log(title = "魅宠记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZfPet zfPet)
    {
        return toAjax(zfPetService.save(zfPet));
    }
    /**
     * 修改魅宠记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:edit')")
    @Log(title = "魅宠记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZfPet zfPet)
    {
        return toAjax(zfPetService.updateById(zfPet));
    }
//
    /**
     * 批量删除魅宠记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:remove')")
    @Log(title = "魅宠记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zfPetService.removeByIds(Arrays.asList(ids)));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfPetNoteController.java
@@ -1,19 +1,29 @@
package com.ruoyi.web.controller.zhang;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZfPetNote;
import com.ruoyi.domain.ZfProperty;
import com.ruoyi.service.ZfPetNoteService;
import com.ruoyi.service.ZfPetNoteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.util.Arrays;
import java.util.List;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
/**
 * <p>
@@ -25,96 +35,99 @@
 */
@RestController
@RequestMapping("/family/zfPetNote")
public class ZfPetNoteController {
@Slf4j
public class ZfPetNoteController extends BaseController {
    @Resource
    private ZfPetNoteService zfPetNoteService;
//    @GetMapping("/all")
//    public AjaxResult  listAll(ZfProperty zfProperty){
//        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
//        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
//        return zfPropertyService.selectUserList(zfProperty, pageNum, pageSize);
//    }
    @GetMapping("/all")
    public AjaxResult listAll(ZfPetNote zfPetNote){
        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfPetNoteService.selectPetNoteList(zfPetNote, pageNum, pageSize);
    }
    /**
     * 根据宠物id获取相关备忘录
     */
    @GetMapping
    public AjaxResult getByPetId(@PathParam("pid")Long pid){
        return zfPetNoteService.getAllPetNoteByPetId(pid);
    }
    /**
     * 导出魅宠备忘录记录列表
     */
//    @PreAuthorize("@ss.hasPermi('system:property:export')")
    @Log(title = "魅宠备忘录记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZfPetNote zfPetNote)
    {
        List<ZfPetNote> list = zfPetNoteService.selectByCondition(zfPetNote);
        log.info("导出记录为:{}",list);
        ExcelUtil<ZfPetNote> util = new ExcelUtil<>(ZfPetNote.class);
        util.exportExcel(response, list, "魅宠备忘录记录数据");
    }
    /**
     * 导入魅宠备忘录记录列表
     */
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @PostMapping("/importData")
    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
    {
        ExcelUtil<ZfPetNote> util = new ExcelUtil<>(ZfPetNote.class);
        List<ZfPetNote> eventList = util.importExcel(file.getInputStream());
        log.info("魅宠备忘录列表为:{}",eventList);
        if (zfPetNoteService.saveBatch(eventList)) {
            return AjaxResult.success("导入数据成功");
        }
        return AjaxResult.error("导入数据失败");
    }
    /**
     * 获取魅宠备忘录记录详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:property:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zfPetNoteService.getById(id));
    }
//
    /**
     * 新增魅宠备忘录记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:add')")
    @Log(title = "魅宠备忘录记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZfPetNote zfPetNote)
    {
        return toAjax(zfPetNoteService.save(zfPetNote));
    }
    /**
     * 修改魅宠备忘录记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:edit')")
    @Log(title = "魅宠备忘录记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZfPetNote zfPetNote)
    {
        return toAjax(zfPetNoteService.updateById(zfPetNote));
    }
//
//    /**
//     * 导出家庭资产记录列表
//     */
////    @PreAuthorize("@ss.hasPermi('system:property:export')")
//    @Log(title = "家庭资产记录", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, ZfProperty zfProperty)
//    {
//        List<ZfProperty> list = zfPropertyService.selectByCondition(zfProperty);
//        log.info("导出记录为:{}",list);
//        ExcelUtil<ZfProperty> util = new ExcelUtil<ZfProperty>(ZfProperty.class);
//        util.exportExcel(response, list, "家庭资产记录数据");
//    }
////
//
//    /**
//     * 导入家庭资产记录列表
//     */
//    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
//    @PostMapping("/importData")
//    public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
//    {
//        ExcelUtil<ZfProperty> util = new ExcelUtil<>(ZfProperty.class);
//        List<ZfProperty> propertyList = util.importExcel(file.getInputStream());
//        log.info("资产列表为:{}",propertyList);
//
//        if (zfPropertyService.saveBatch(propertyList)) {
//            return AjaxResult.success("导入数据成功");
//        }
//
//        return AjaxResult.error("导入数据失败");
//
//    }
//
//
//    /**
//     * 获取家庭资产记录详细信息
//     */
////    @PreAuthorize("@ss.hasPermi('system:property:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return success(zfPropertyService.getById(id));
//    }
////
//    /**
//     * 新增家庭资产记录
//     */
////    @PreAuthorize("@ss.hasPermi('system:property:add')")
//    @Log(title = "家庭资产记录", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody ZfProperty zfProperty)
//    {
//        return toAjax(zfPropertyService.save(zfProperty));
//    }
//
//    /**
//     * 修改家庭资产记录
//     */
////    @PreAuthorize("@ss.hasPermi('system:property:edit')")
//    @Log(title = "家庭资产记录", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody ZfProperty zfProperty)
//    {
//        return toAjax(zfPropertyService.updateById(zfProperty));
//    }
////
//    /**
//     * 批量删除家庭资产记录
//     */
////    @PreAuthorize("@ss.hasPermi('system:property:remove')")
//    @Log(title = "家庭资产记录", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids)
//    {
//        return toAjax(zfPropertyService.removeByIds(Arrays.asList(ids)));
//    }
    /**
     * 批量删除魅宠备忘录记录
     */
//    @PreAuthorize("@ss.hasPermi('system:property:remove')")
    @Log(title = "魅宠备忘录记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zfPetNoteService.removeByIds(Arrays.asList(ids)));
    }
}
ruoyi-admin/src/test/java/com/ruoyi/insertData.java
@@ -1,6 +1,8 @@
package com.ruoyi;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.domain.ZfEvent;
import com.ruoyi.service.ZfDoctorService;
import com.ruoyi.service.ZfEventService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +23,9 @@
    @Autowired
    private ZfEventService zfEventService;
    @Autowired
    private ZfDoctorService zfDoctorService;
    @Test
    public void insert(){
@@ -49,4 +54,34 @@
        }
    }
    @Test
    void insertDoctor(){
        List<String> l1 = Arrays.asList("牙科", "神经科","外科");
        List<String> l2 = Arrays.asList("牙痛", "头痛", "皮肤炎");
        List<String> l3 = Arrays.asList("一个月", "半个月", "一天");
        List<String> l4 = Arrays.asList("白芷10g", "中医药1", "中医药2");
        List<String> l5 = Arrays.asList("维生素C", "布洛芬", "皮康霜");
        List<String> l6 = Arrays.asList("缓解牙痛", "缓解头痛", "缓解皮肤炎");
        List<String> l7 = Arrays.asList("张三", "李四", "王五");
        List<String> l8 = Arrays.asList("专治牙痛", "专治头痛", "专治皮肤炎");
        ZfDoctor zfDoctor=null;
        int count=0;
        for (int i = 0; i < 200; i++) {
            count=count%3;
            zfDoctor=new ZfDoctor();
            zfDoctor.setType(l1.get(count));
            zfDoctor.setSymptom(l2.get(count));
            zfDoctor.setDuration(l3.get(count));
            zfDoctor.setCMedical(l4.get(count));
            zfDoctor.setWMedical(l5.get(count));
            zfDoctor.setEffect(l6.get(count));
            zfDoctor.setSuitable(l7.get(count));
            zfDoctor.setRemark(l8.get(count));
            zfDoctor.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg");
            count++;
            zfDoctorService.save(zfDoctor);
        }
    }
}
zhang-content/src/main/java/com/ruoyi/domain/ZfDoctor.java
@@ -3,6 +3,10 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
@@ -14,138 +18,63 @@
 * @since 2023-03-12
 */
@TableName("zf_doctor")
@Data
@ToString
public class ZfDoctor implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Long id;
    /**
     * 病的类型
     */
    @Excel(name = "病的类型")
    private String type;
    /**
     * 症状
     */
    @Excel(name = "症状")
    private String symptom;
    /**
     * 持续时间
     */
    @Excel(name = "持续时间")
    private String duration;
    /**
     * 中医
     */
    private String cMedical;
    @Excel(name = "中医")
    private String cmedical;
    /**
     * 西医
     */
    private String wMedical;
    @Excel(name = "西医")
    private String wmedical;
    /**
     * 功效
     */
    @Excel(name = "功效")
    private String effect;
    /**
     * 适用人
     */
    @Excel(name = "适用人")
    private String suitable;
    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;
    private String url;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getSymptom() {
        return symptom;
    }
    public void setSymptom(String symptom) {
        this.symptom = symptom;
    }
    public String getDuration() {
        return duration;
    }
    public void setDuration(String duration) {
        this.duration = duration;
    }
    public String getcMedical() {
        return cMedical;
    }
    public void setcMedical(String cMedical) {
        this.cMedical = cMedical;
    }
    public String getwMedical() {
        return wMedical;
    }
    public void setwMedical(String wMedical) {
        this.wMedical = wMedical;
    }
    public String getEffect() {
        return effect;
    }
    public void setEffect(String effect) {
        this.effect = effect;
    }
    public String getSuitable() {
        return suitable;
    }
    public void setSuitable(String suitable) {
        this.suitable = suitable;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Override
    public String toString() {
        return "ZfDoctor{" +
        "id=" + id +
        ", type=" + type +
        ", symptom=" + symptom +
        ", duration=" + duration +
        ", cMedical=" + cMedical +
        ", wMedical=" + wMedical +
        ", effect=" + effect +
        ", suitable=" + suitable +
        ", remark=" + remark +
        "}";
    }
}
zhang-content/src/main/java/com/ruoyi/domain/ZfMaster.java
@@ -3,6 +3,9 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
@@ -14,166 +17,72 @@
 * @since 2023-03-12
 */
@TableName("zf_master")
@Data
public class ZfMaster implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Long id;
    /**
     * 宠物表id
     * 宠物id
     */
    private Integer petId;
    private Long petId;
    /**
     * 养犬人姓名
     */
    @Excel(name = "name")
    private String name;
    /**
     * 证件类型
     */
    @Excel(name="证件类型")
    private String certificateType;
    /**
     * 证件号码
     */
    @Excel(name = "证件号码")
    private String certificateNo;
    /**
     * 固定电话
     */
    @Excel(name = "固定电话")
    private String fixedNo;
    /**
     * 移动电话
     */
    @Excel(name = "移动电话")
    private String phoneNo;
    /**
     * 拥有犬只数量
     * 拥有宠物数量
     */
    @Excel(name = "拥有宠物数量")
    private Integer many;
    /**
     * 住所详细地址
     */
    @Excel(name = "住所详细地址")
    private String address;
    /**
     * 住所性质
     */
    @Excel(name = "住所性质")
    private String property;
    /**
     * 电子邮件
     */
    @Excel(name = "邮箱")
    private String email;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getPetId() {
        return petId;
    }
    public void setPetId(Integer petId) {
        this.petId = petId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCertificateType() {
        return certificateType;
    }
    public void setCertificateType(String certificateType) {
        this.certificateType = certificateType;
    }
    public String getCertificateNo() {
        return certificateNo;
    }
    public void setCertificateNo(String certificateNo) {
        this.certificateNo = certificateNo;
    }
    public String getFixedNo() {
        return fixedNo;
    }
    public void setFixedNo(String fixedNo) {
        this.fixedNo = fixedNo;
    }
    public String getPhoneNo() {
        return phoneNo;
    }
    public void setPhoneNo(String phoneNo) {
        this.phoneNo = phoneNo;
    }
    public Integer getMany() {
        return many;
    }
    public void setMany(Integer many) {
        this.many = many;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getProperty() {
        return property;
    }
    public void setProperty(String property) {
        this.property = property;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    @Override
    public String toString() {
        return "ZfMaster{" +
        "id=" + id +
        ", petId=" + petId +
        ", name=" + name +
        ", certificateType=" + certificateType +
        ", certificateNo=" + certificateNo +
        ", fixedNo=" + fixedNo +
        ", phoneNo=" + phoneNo +
        ", many=" + many +
        ", address=" + address +
        ", property=" + property +
        ", email=" + email +
        "}";
    }
}
zhang-content/src/main/java/com/ruoyi/domain/ZfPet.java
@@ -3,8 +3,14 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
/**
 * <p>
@@ -15,194 +21,88 @@
 * @since 2023-03-12
 */
@TableName("zf_pet")
@Data
@ToString
public class ZfPet implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Long id;
    /**
     * 犬证号码
     * 宠物号码
     */
    @Excel(name = "宠物号码")
    private String idNum;
    /**
     * 防伪码
     */
    @Excel(name = "防伪码")
    private String securityCode;
    /**
     * 犬种
     * 宠物品种
     */
    @Excel(name = "宠物品种")
    private String type;
    /**
     * 犬名
     * 宠物名称
     */
    @Excel(name = "宠物名称")
    private String name;
    /**
     * 出生日期
     */
    private LocalDate birth;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出生日期", dateFormat = "yyyy-MM-dd")
    private Date birth;
    /**
     * 性别,0:雌,1:雄
     */
    @Excel(name = "性别",readConverterExp = "0=雌,1=雄")
    private Integer sex;
    /**
     * 犬只颜色
     * 宠物颜色
     */
    @Excel(name = "宠物颜色")
    private String color;
    /**
     * 犬只性质
     * 宠物性质
     */
    @Excel(name = "宠物性质")
    private String properties;
    /**
     * 饮食习惯
     */
    @Excel(name = "饮食习惯")
    private String eatHabit;
    /**
     * 生活习惯
     */
    @Excel(name = "生活习惯")
    private String lifeHabit;
    /**
     * 犬居住地址
     */
    @Excel(name = "宠物居住地址")
    private String address;
    /**
     * 能听懂的方言
     */
    @Excel(name = "能听懂的方言")
    private String dialect;
    private String url;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getIdNum() {
        return idNum;
    }
    public void setIdNum(String idNum) {
        this.idNum = idNum;
    }
    public String getSecurityCode() {
        return securityCode;
    }
    public void setSecurityCode(String securityCode) {
        this.securityCode = securityCode;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public LocalDate getBirth() {
        return birth;
    }
    public void setBirth(LocalDate birth) {
        this.birth = birth;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
    public String getProperties() {
        return properties;
    }
    public void setProperties(String properties) {
        this.properties = properties;
    }
    public String getEatHabit() {
        return eatHabit;
    }
    public void setEatHabit(String eatHabit) {
        this.eatHabit = eatHabit;
    }
    public String getLifeHabit() {
        return lifeHabit;
    }
    public void setLifeHabit(String lifeHabit) {
        this.lifeHabit = lifeHabit;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getDialect() {
        return dialect;
    }
    public void setDialect(String dialect) {
        this.dialect = dialect;
    }
    @Override
    public String toString() {
        return "ZfPet{" +
        "id=" + id +
        ", idNum=" + idNum +
        ", securityCode=" + securityCode +
        ", type=" + type +
        ", name=" + name +
        ", birth=" + birth +
        ", sex=" + sex +
        ", color=" + color +
        ", properties=" + properties +
        ", eatHabit=" + eatHabit +
        ", lifeHabit=" + lifeHabit +
        ", address=" + address +
        ", dialect=" + dialect +
        "}";
    }
}
zhang-content/src/main/java/com/ruoyi/domain/ZfPetNote.java
@@ -3,8 +3,13 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * <p>
@@ -15,96 +20,46 @@
 * @since 2023-03-12
 */
@TableName("zf_pet_note")
@Data
@ToString
public class ZfPetNote implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Long id;
    /**
     * 宠物表id
     * 宠物id
     */
    private Integer pid;
    private Long pid;
    /**
     * 记录时间
     */
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录时间", dateFormat = "yyyy-MM-dd")
    private Date createTime;
    /**
     * 题名
     */
    @Excel(name = "题名")
    private String title;
    /**
     * 提醒时间
     */
    private LocalDateTime remindTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "提醒时间", dateFormat = "yyyy-MM-dd")
    private Date remindTime;
    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;
    private String url;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getPid() {
        return pid;
    }
    public void setPid(Integer pid) {
        this.pid = pid;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public LocalDateTime getRemindTime() {
        return remindTime;
    }
    public void setRemindTime(LocalDateTime remindTime) {
        this.remindTime = remindTime;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Override
    public String toString() {
        return "ZfPetNote{" +
        "id=" + id +
        ", pid=" + pid +
        ", createTime=" + createTime +
        ", title=" + title +
        ", remindTime=" + remindTime +
        ", remark=" + remark +
        "}";
    }
}
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorService.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfDoctor;
import java.util.List;
/**
 * <p>
@@ -14,4 +17,7 @@
 */
public interface ZfDoctorService extends IService<ZfDoctor> {
    AjaxResult selectDoctorList(ZfDoctor zfDoctor, Integer pageNum, Integer pageSize);
    List<ZfDoctor> selectByCondition(ZfDoctor zfDoctor);
}
zhang-content/src/main/java/com/ruoyi/service/ZfMasterService.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfMaster;
import java.util.List;
/**
 * <p>
@@ -14,4 +17,8 @@
 */
public interface ZfMasterService extends IService<ZfMaster> {
    AjaxResult getMasterInfoByPetId(Long pid);
    List<ZfMaster> selectByCondition(ZfMaster zfMaster);
}
zhang-content/src/main/java/com/ruoyi/service/ZfPetNoteService.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfPetNote;
import java.util.List;
/**
 * <p>
@@ -14,4 +17,9 @@
 */
public interface ZfPetNoteService extends IService<ZfPetNote> {
    AjaxResult selectPetNoteList(ZfPetNote zfPetNote, Integer pageNum, Integer pageSize);
    List<ZfPetNote> selectByCondition(ZfPetNote zfPetNote);
    AjaxResult getAllPetNoteByPetId(Long pid);
}
zhang-content/src/main/java/com/ruoyi/service/ZfPetService.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfPet;
import java.util.List;
/**
 * <p>
@@ -14,4 +17,7 @@
 */
public interface ZfPetService extends IService<ZfPet> {
    AjaxResult selectPetList(ZfPet zfPet, Integer pageNum, Integer pageSize);
    List<ZfPet> selectByCondition(ZfPet zfPet);
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java
@@ -1,11 +1,20 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.mapper.ZfDoctorMapper;
import com.ruoyi.service.ZfDoctorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
 * <p>
@@ -16,6 +25,38 @@
 * @since 2023-03-12
 */
@Service
@Slf4j
public class ZfDoctorServiceImpl extends ServiceImpl<ZfDoctorMapper, ZfDoctor> implements ZfDoctorService {
    @Override
    public AjaxResult selectDoctorList(ZfDoctor zfDoctor, Integer pageNum, Integer pageSize) {
        LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor);
        Page<ZfDoctor> ZfDoctorPage = new Page<>(pageNum,pageSize);
        Page<ZfDoctor> pageResult = page(ZfDoctorPage, lqw);
        HashMap<String, Object> data = MapUtils.getResult(pageResult);
        return AjaxResult.success(data);
    }
    @Override
    public List<ZfDoctor> selectByCondition(ZfDoctor zfDoctor) {
        LambdaQueryWrapper<ZfDoctor> lambdaQueryWrapper = buildCondition(zfDoctor);
        List<ZfDoctor> list = list(lambdaQueryWrapper);
        log.info("返回的数据为:{}",list);
        return list;
    }
    private LambdaQueryWrapper<ZfDoctor> buildCondition(ZfDoctor zfDoctor) {
        LambdaQueryWrapper<ZfDoctor> lqw = new LambdaQueryWrapper<>();
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getType()),ZfDoctor::getType,zfDoctor.getType());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getSymptom()),ZfDoctor::getSymptom,zfDoctor.getSymptom());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getDuration()),ZfDoctor::getDuration,zfDoctor.getDuration());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getCmedical()),ZfDoctor::getCmedical,zfDoctor.getCmedical());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getWmedical()),ZfDoctor::getWmedical,zfDoctor.getWmedical());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getEffect()),ZfDoctor::getEffect,zfDoctor.getEffect());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getSuitable()),ZfDoctor::getSuitable,zfDoctor.getSuitable());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getRemark()),ZfDoctor::getRemark,zfDoctor.getRemark());
        return lqw;
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfMasterServiceImpl.java
@@ -1,11 +1,17 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.ZfMaster;
import com.ruoyi.mapper.ZfMasterMapper;
import com.ruoyi.service.ZfMasterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -16,6 +22,36 @@
 * @since 2023-03-12
 */
@Service
@Slf4j
public class ZfMasterServiceImpl extends ServiceImpl<ZfMasterMapper, ZfMaster> implements ZfMasterService {
    @Override
    public AjaxResult getMasterInfoByPetId(Long pid) {
        LambdaQueryWrapper<ZfMaster> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfMaster::getPetId,pid);
        ZfMaster master = getOne(lqw);
        return AjaxResult.success(master);
    }
    @Override
    public List<ZfMaster> selectByCondition(ZfMaster zfMaster) {
        LambdaQueryWrapper<ZfMaster> lambdaQueryWrapper = buildCondition(zfMaster);
        List<ZfMaster> list = list(lambdaQueryWrapper);
        log.info("返回的数据为:{}",list);
        return list;
    }
    private LambdaQueryWrapper<ZfMaster> buildCondition(ZfMaster zfMaster) {
        LambdaQueryWrapper<ZfMaster> lqw = new LambdaQueryWrapper<>();
        lqw.like(zfMaster.getPetId()!=null,ZfMaster::getPetId,zfMaster.getPetId());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getName()),ZfMaster::getName,zfMaster.getName());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getCertificateType()),ZfMaster::getCertificateType,zfMaster.getCertificateType());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getFixedNo()),ZfMaster::getFixedNo,zfMaster.getFixedNo());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getPhoneNo()),ZfMaster::getPhoneNo,zfMaster.getPhoneNo());
        lqw.eq(zfMaster.getMany()!=null,ZfMaster::getMany,zfMaster.getMany());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getAddress()),ZfMaster::getAddress,zfMaster.getAddress());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getProperty()),ZfMaster::getProperty,zfMaster.getProperty());
        lqw.like(StringUtils.isNotEmpty(zfMaster.getEmail()),ZfMaster::getEmail,zfMaster.getEmail());
        return lqw;
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetNoteServiceImpl.java
@@ -1,11 +1,20 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.ZfPetNote;
import com.ruoyi.mapper.ZfPetNoteMapper;
import com.ruoyi.service.ZfPetNoteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
 * <p>
@@ -16,6 +25,40 @@
 * @since 2023-03-12
 */
@Service
@Slf4j
public class ZfPetNoteServiceImpl extends ServiceImpl<ZfPetNoteMapper, ZfPetNote> implements ZfPetNoteService {
    @Override
    public AjaxResult selectPetNoteList(ZfPetNote zfPetNote, Integer pageNum, Integer pageSize) {
        LambdaQueryWrapper<ZfPetNote> lqw = buildCondition(zfPetNote);
        Page<ZfPetNote> ZfPetNotePage = new Page<>(pageNum,pageSize);
        Page<ZfPetNote> pageResult = page(ZfPetNotePage, lqw);
        HashMap<String, Object> data = MapUtils.getResult(pageResult);
        return AjaxResult.success(data);
    }
    @Override
    public List<ZfPetNote> selectByCondition(ZfPetNote zfPetNote) {
        LambdaQueryWrapper<ZfPetNote> lambdaQueryWrapper = buildCondition(zfPetNote);
        List<ZfPetNote> list = list(lambdaQueryWrapper);
        log.info("返回的数据为:{}",list);
        return list;
    }
    @Override
    public AjaxResult getAllPetNoteByPetId(Long pid) {
        LambdaQueryWrapper<ZfPetNote> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfPetNote::getPid,pid);
        List<ZfPetNote> list = list(lqw);
        return AjaxResult.success(list);
    }
    private LambdaQueryWrapper<ZfPetNote> buildCondition(ZfPetNote zfPetNote) {
        LambdaQueryWrapper<ZfPetNote> lqw = new LambdaQueryWrapper<>();
        lqw.like(StringUtils.isNotEmpty(zfPetNote.getTitle()),ZfPetNote::getTitle,zfPetNote.getTitle());
        lqw.like(zfPetNote.getCreateTime()!=null,ZfPetNote::getCreateTime,zfPetNote.getCreateTime());
        lqw.like(zfPetNote.getRemindTime()!=null,ZfPetNote::getRemindTime,zfPetNote.getRemindTime());
        lqw.like(StringUtils.isNotEmpty(zfPetNote.getRemark()),ZfPetNote::getRemark,zfPetNote.getRemark());
        return lqw;
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java
@@ -1,11 +1,21 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.ZfPet;
import com.ruoyi.mapper.ZfPetMapper;
import com.ruoyi.service.ZfPetService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.StringUtil;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
 * <p>
@@ -16,6 +26,40 @@
 * @since 2023-03-12
 */
@Service
@Slf4j
public class ZfPetServiceImpl extends ServiceImpl<ZfPetMapper, ZfPet> implements ZfPetService {
    @Override
    public AjaxResult selectPetList(ZfPet zfPet, Integer pageNum, Integer pageSize) {
        LambdaQueryWrapper<ZfPet> lqw = buildCondition(zfPet);
        Page<ZfPet> ZfPetPage = new Page<>(pageNum,pageSize);
        Page<ZfPet> pageResult = page(ZfPetPage, lqw);
        HashMap<String, Object> data = MapUtils.getResult(pageResult);
        return AjaxResult.success(data);
    }
    @Override
    public List<ZfPet> selectByCondition(ZfPet zfPet) {
        LambdaQueryWrapper<ZfPet> lambdaQueryWrapper = buildCondition(zfPet);
        List<ZfPet> list = list(lambdaQueryWrapper);
        log.info("返回的数据为:{}",list);
        return list;
    }
    private LambdaQueryWrapper<ZfPet> buildCondition(ZfPet zfPet) {
        LambdaQueryWrapper<ZfPet> lqw = new LambdaQueryWrapper<>();
        lqw.like(StringUtils.isNotEmpty(zfPet.getIdNum()),ZfPet::getIdNum,zfPet.getIdNum());
        lqw.like(StringUtils.isNotEmpty(zfPet.getSecurityCode()),ZfPet::getSecurityCode,zfPet.getSecurityCode());
        lqw.like(StringUtils.isNotEmpty(zfPet.getType()),ZfPet::getType,zfPet.getType());
        lqw.like(StringUtils.isNotEmpty(zfPet.getName()),ZfPet::getName,zfPet.getName());
        lqw.like(zfPet.getBirth()!=null,ZfPet::getBirth,zfPet.getBirth());
        lqw.like(zfPet.getSex()!=null,ZfPet::getSex,zfPet.getSex());
        lqw.like(StringUtils.isNotEmpty(zfPet.getColor()),ZfPet::getColor,zfPet.getColor());
        lqw.like(StringUtils.isNotEmpty(zfPet.getProperties()),ZfPet::getProperties,zfPet.getProperties());
        lqw.like(StringUtils.isNotEmpty(zfPet.getEatHabit()),ZfPet::getEatHabit,zfPet.getEatHabit());
        lqw.like(StringUtils.isNotEmpty(zfPet.getLifeHabit()),ZfPet::getLifeHabit,zfPet.getLifeHabit());
        lqw.like(StringUtils.isNotEmpty(zfPet.getAddress()),ZfPet::getAddress,zfPet.getAddress());
        lqw.like(StringUtils.isNotEmpty(zfPet.getDialect()),ZfPet::getDialect,zfPet.getDialect());
        return lqw;
    }
}