feat(pet): 添加宠物模块和AI智能分诊功能
- 在application.yml中配置了AI端模块和pet端模块的包扫描路径 - 创建了BizPets实体类用于宠物基础档案管理 - 实现了宠物相关的业务对象、控制器、映射器和服务层 - 添加了多模态问诊对话明细相关实体和业务逻辑 - 实现了AI智能分诊会话功能支持 - 配置了完整的CRUD操作和数据验证机制
This commit is contained in:
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.pet.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.pet.domain.vo.BizPetsVo;
|
||||
import org.dromara.pet.domain.bo.BizPetsBo;
|
||||
import org.dromara.pet.service.IBizPetsService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 宠物基础档案
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/pet/pets")
|
||||
public class BizPetsController extends BaseController {
|
||||
|
||||
private final IBizPetsService bizPetsService;
|
||||
|
||||
/**
|
||||
* 查询宠物基础档案列表
|
||||
*/
|
||||
@SaCheckPermission("pet:pets:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BizPetsVo> list(BizPetsBo bo, PageQuery pageQuery) {
|
||||
return bizPetsService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出宠物基础档案列表
|
||||
*/
|
||||
@SaCheckPermission("pet:pets:export")
|
||||
@Log(title = "宠物基础档案", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BizPetsBo bo, HttpServletResponse response) {
|
||||
List<BizPetsVo> list = bizPetsService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "宠物基础档案", BizPetsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取宠物基础档案详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("pet:pets:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BizPetsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(bizPetsService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宠物基础档案
|
||||
*/
|
||||
@SaCheckPermission("pet:pets:add")
|
||||
@Log(title = "宠物基础档案", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BizPetsBo bo) {
|
||||
return toAjax(bizPetsService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宠物基础档案
|
||||
*/
|
||||
@SaCheckPermission("pet:pets:edit")
|
||||
@Log(title = "宠物基础档案", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BizPetsBo bo) {
|
||||
return toAjax(bizPetsService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除宠物基础档案
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("pet:pets:remove")
|
||||
@Log(title = "宠物基础档案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(bizPetsService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.pet.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.pet.domain.vo.BizTriageMessagesVo;
|
||||
import org.dromara.pet.domain.bo.BizTriageMessagesBo;
|
||||
import org.dromara.pet.service.IBizTriageMessagesService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/pet/triageMessages")
|
||||
public class BizTriageMessagesController extends BaseController {
|
||||
|
||||
private final IBizTriageMessagesService bizTriageMessagesService;
|
||||
|
||||
/**
|
||||
* 查询多模态问诊对话明细列表
|
||||
*/
|
||||
@SaCheckPermission("pet:triageMessages:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BizTriageMessagesVo> list(BizTriageMessagesBo bo, PageQuery pageQuery) {
|
||||
return bizTriageMessagesService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出多模态问诊对话明细列表
|
||||
*/
|
||||
@SaCheckPermission("pet:triageMessages:export")
|
||||
@Log(title = "多模态问诊对话明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BizTriageMessagesBo bo, HttpServletResponse response) {
|
||||
List<BizTriageMessagesVo> list = bizTriageMessagesService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "多模态问诊对话明细", BizTriageMessagesVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取多模态问诊对话明细详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("pet:triageMessages:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BizTriageMessagesVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(bizTriageMessagesService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增多模态问诊对话明细
|
||||
*/
|
||||
@SaCheckPermission("pet:triageMessages:add")
|
||||
@Log(title = "多模态问诊对话明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BizTriageMessagesBo bo) {
|
||||
return toAjax(bizTriageMessagesService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改多模态问诊对话明细
|
||||
*/
|
||||
@SaCheckPermission("pet:triageMessages:edit")
|
||||
@Log(title = "多模态问诊对话明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BizTriageMessagesBo bo) {
|
||||
return toAjax(bizTriageMessagesService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除多模态问诊对话明细
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("pet:triageMessages:remove")
|
||||
@Log(title = "多模态问诊对话明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(bizTriageMessagesService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.pet.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.pet.domain.vo.BizTriageSessionsVo;
|
||||
import org.dromara.pet.domain.bo.BizTriageSessionsBo;
|
||||
import org.dromara.pet.service.IBizTriageSessionsService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* AI智能分诊会话
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/pet/triageSessions")
|
||||
public class BizTriageSessionsController extends BaseController {
|
||||
|
||||
private final IBizTriageSessionsService bizTriageSessionsService;
|
||||
|
||||
/**
|
||||
* 查询AI智能分诊会话列表
|
||||
*/
|
||||
@SaCheckPermission("pet:triageSessions:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BizTriageSessionsVo> list(BizTriageSessionsBo bo, PageQuery pageQuery) {
|
||||
return bizTriageSessionsService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出AI智能分诊会话列表
|
||||
*/
|
||||
@SaCheckPermission("pet:triageSessions:export")
|
||||
@Log(title = "AI智能分诊会话", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BizTriageSessionsBo bo, HttpServletResponse response) {
|
||||
List<BizTriageSessionsVo> list = bizTriageSessionsService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "AI智能分诊会话", BizTriageSessionsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AI智能分诊会话详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("pet:triageSessions:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BizTriageSessionsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(bizTriageSessionsService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AI智能分诊会话
|
||||
*/
|
||||
@SaCheckPermission("pet:triageSessions:add")
|
||||
@Log(title = "AI智能分诊会话", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BizTriageSessionsBo bo) {
|
||||
return toAjax(bizTriageSessionsService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AI智能分诊会话
|
||||
*/
|
||||
@SaCheckPermission("pet:triageSessions:edit")
|
||||
@Log(title = "AI智能分诊会话", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BizTriageSessionsBo bo) {
|
||||
return toAjax(bizTriageSessionsService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AI智能分诊会话
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("pet:triageSessions:remove")
|
||||
@Log(title = "AI智能分诊会话", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(bizTriageSessionsService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package org.dromara.pet.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 宠物基础档案对象 biz_pets
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("biz_pets")
|
||||
public class BizPets extends
|
||||
|
||||
BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 归属用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 宠物昵称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 物种(DOG狗/CAT猫)
|
||||
*/
|
||||
private String species;
|
||||
|
||||
/**
|
||||
* 品种
|
||||
*/
|
||||
private String breed;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 体重(公斤)
|
||||
*/
|
||||
private Long weightKg;
|
||||
|
||||
/**
|
||||
* 性别(MALE公/FEMALE母)
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 是否绝育(Y/N)
|
||||
*/
|
||||
private String isNeutered;
|
||||
|
||||
/**
|
||||
* 头像链接
|
||||
*/
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* 业务创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 业务更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.dromara.pet.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细对象 biz_triage_messages
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("biz_triage_messages")
|
||||
public class BizTriageMessages extends
|
||||
|
||||
BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联分诊会话ID
|
||||
*/
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 发送者角色(USER用户/AI模型)
|
||||
*/
|
||||
private String senderRole;
|
||||
|
||||
/**
|
||||
* 消息类型(TEXT/IMAGE/VIDEO)
|
||||
*/
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 多媒体文件链接
|
||||
*/
|
||||
private String mediaUrl;
|
||||
|
||||
/**
|
||||
* 业务发送时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package org.dromara.pet.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* AI智能分诊会话对象 biz_triage_sessions
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("biz_triage_sessions")
|
||||
public class BizTriageSessions extends
|
||||
|
||||
BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 关联宠物ID
|
||||
*/
|
||||
private Long petId;
|
||||
|
||||
/**
|
||||
* 会话状态(ONGOING进行中/COMPLETED已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 风险等级(GREEN低/YELLOW中/RED高)
|
||||
*/
|
||||
private String riskLevel;
|
||||
|
||||
/**
|
||||
* AI病情摘要总结
|
||||
*/
|
||||
private String aiSummary;
|
||||
|
||||
/**
|
||||
* 行动建议指南
|
||||
*/
|
||||
private String actionPlan;
|
||||
|
||||
/**
|
||||
* 业务创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 业务更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package org.dromara.pet.domain.bo;
|
||||
|
||||
import org.dromara.pet.domain.BizPets;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 宠物基础档案业务对象 biz_pets
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizPets.class,reverseConvertGenerate =false)
|
||||
|
||||
public class BizPetsBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 归属用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 宠物昵称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 物种(DOG狗/CAT猫)
|
||||
*/
|
||||
private String species;
|
||||
|
||||
/**
|
||||
* 品种
|
||||
*/
|
||||
@NotBlank(message = "品种不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String breed;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
@NotNull(message = "出生日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 体重(公斤)
|
||||
*/
|
||||
@NotNull(message = "体重(公斤)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long weightKg;
|
||||
|
||||
/**
|
||||
* 性别(MALE公/FEMALE母)
|
||||
*/
|
||||
@NotBlank(message = "性别(MALE公/FEMALE母)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 是否绝育(Y/N)
|
||||
*/
|
||||
@NotBlank(message = "是否绝育(Y/N)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isNeutered;
|
||||
|
||||
/**
|
||||
* 头像链接
|
||||
*/
|
||||
@NotBlank(message = "头像链接不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* 业务创建时间
|
||||
*/
|
||||
@NotNull(message = "业务创建时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 业务更新时间
|
||||
*/
|
||||
@NotNull(message = "业务更新时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package org.dromara.pet.domain.bo;
|
||||
|
||||
import org.dromara.pet.domain.BizTriageMessages;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细业务对象 biz_triage_messages
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizTriageMessages.class,reverseConvertGenerate =false)
|
||||
|
||||
public class BizTriageMessagesBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联分诊会话ID
|
||||
*/
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 发送者角色(USER用户/AI模型)
|
||||
*/
|
||||
private String senderRole;
|
||||
|
||||
/**
|
||||
* 消息类型(TEXT/IMAGE/VIDEO)
|
||||
*/
|
||||
@NotBlank(message = "消息类型(TEXT/IMAGE/VIDEO)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
@NotBlank(message = "文本内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 多媒体文件链接
|
||||
*/
|
||||
@NotBlank(message = "多媒体文件链接不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String mediaUrl;
|
||||
|
||||
/**
|
||||
* 业务发送时间
|
||||
*/
|
||||
@NotNull(message = "业务发送时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date createdAt;
|
||||
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package org.dromara.pet.domain.bo;
|
||||
|
||||
import org.dromara.pet.domain.BizTriageSessions;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* AI智能分诊会话业务对象 biz_triage_sessions
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BizTriageSessions.class,reverseConvertGenerate =false)
|
||||
|
||||
public class BizTriageSessionsBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 关联宠物ID
|
||||
*/
|
||||
private Long petId;
|
||||
|
||||
/**
|
||||
* 会话状态(ONGOING进行中/COMPLETED已完成)
|
||||
*/
|
||||
@NotBlank(message = "会话状态(ONGOING进行中/COMPLETED已完成)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 风险等级(GREEN低/YELLOW中/RED高)
|
||||
*/
|
||||
@NotBlank(message = "风险等级(GREEN低/YELLOW中/RED高)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String riskLevel;
|
||||
|
||||
/**
|
||||
* AI病情摘要总结
|
||||
*/
|
||||
@NotBlank(message = "AI病情摘要总结不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String aiSummary;
|
||||
|
||||
/**
|
||||
* 行动建议指南
|
||||
*/
|
||||
@NotBlank(message = "行动建议指南不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String actionPlan;
|
||||
|
||||
/**
|
||||
* 业务创建时间
|
||||
*/
|
||||
@NotNull(message = "业务创建时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 业务更新时间
|
||||
*/
|
||||
@NotNull(message = "业务更新时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package org.dromara.pet.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.pet.domain.BizPets;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 宠物基础档案视图对象 biz_pets
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizPets.class)
|
||||
|
||||
public class BizPetsVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 归属用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "归属用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 宠物昵称
|
||||
*/
|
||||
@ExcelProperty(value = "宠物昵称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 物种(DOG狗/CAT猫)
|
||||
*/
|
||||
@ExcelProperty(value = "物种(DOG狗/CAT猫)")
|
||||
private String species;
|
||||
|
||||
/**
|
||||
* 品种
|
||||
*/
|
||||
@ExcelProperty(value = "品种")
|
||||
private String breed;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
@ExcelProperty(value = "出生日期")
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 体重(公斤)
|
||||
*/
|
||||
@ExcelProperty(value = "体重(公斤)")
|
||||
private Long weightKg;
|
||||
|
||||
/**
|
||||
* 性别(MALE公/FEMALE母)
|
||||
*/
|
||||
@ExcelProperty(value = "性别(MALE公/FEMALE母)")
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
* 是否绝育(Y/N)
|
||||
*/
|
||||
@ExcelProperty(value = "是否绝育(Y/N)")
|
||||
private String isNeutered;
|
||||
|
||||
/**
|
||||
* 头像链接
|
||||
*/
|
||||
@ExcelProperty(value = "头像链接")
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* 业务创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "业务创建时间")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 业务更新时间
|
||||
*/
|
||||
@ExcelProperty(value = "业务更新时间")
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package org.dromara.pet.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.pet.domain.BizTriageMessages;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细视图对象 biz_triage_messages
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizTriageMessages.class)
|
||||
|
||||
public class BizTriageMessagesVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联分诊会话ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联分诊会话ID")
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
* 发送者角色(USER用户/AI模型)
|
||||
*/
|
||||
@ExcelProperty(value = "发送者角色(USER用户/AI模型)")
|
||||
private String senderRole;
|
||||
|
||||
/**
|
||||
* 消息类型(TEXT/IMAGE/VIDEO)
|
||||
*/
|
||||
@ExcelProperty(value = "消息类型(TEXT/IMAGE/VIDEO)")
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
@ExcelProperty(value = "文本内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 多媒体文件链接
|
||||
*/
|
||||
@ExcelProperty(value = "多媒体文件链接")
|
||||
private String mediaUrl;
|
||||
|
||||
/**
|
||||
* 业务发送时间
|
||||
*/
|
||||
@ExcelProperty(value = "业务发送时间")
|
||||
private Date createdAt;
|
||||
|
||||
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package org.dromara.pet.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.pet.domain.BizTriageSessions;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* AI智能分诊会话视图对象 biz_triage_sessions
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BizTriageSessions.class)
|
||||
|
||||
public class BizTriageSessionsVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 关联用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 关联宠物ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联宠物ID")
|
||||
private Long petId;
|
||||
|
||||
/**
|
||||
* 会话状态(ONGOING进行中/COMPLETED已完成)
|
||||
*/
|
||||
@ExcelProperty(value = "会话状态(ONGOING进行中/COMPLETED已完成)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 风险等级(GREEN低/YELLOW中/RED高)
|
||||
*/
|
||||
@ExcelProperty(value = "风险等级(GREEN低/YELLOW中/RED高)")
|
||||
private String riskLevel;
|
||||
|
||||
/**
|
||||
* AI病情摘要总结
|
||||
*/
|
||||
@ExcelProperty(value = "AI病情摘要总结")
|
||||
private String aiSummary;
|
||||
|
||||
/**
|
||||
* 行动建议指南
|
||||
*/
|
||||
@ExcelProperty(value = "行动建议指南")
|
||||
private String actionPlan;
|
||||
|
||||
/**
|
||||
* 业务创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "业务创建时间")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 业务更新时间
|
||||
*/
|
||||
@ExcelProperty(value = "业务更新时间")
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.pet.mapper;
|
||||
|
||||
import org.dromara.pet.domain.BizPets;
|
||||
import org.dromara.pet.domain.vo.BizPetsVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 宠物基础档案Mapper接口
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
public interface BizPetsMapper extends BaseMapperPlus<BizPets, BizPetsVo> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.pet.mapper;
|
||||
|
||||
import org.dromara.pet.domain.BizTriageMessages;
|
||||
import org.dromara.pet.domain.vo.BizTriageMessagesVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细Mapper接口
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
public interface BizTriageMessagesMapper extends BaseMapperPlus<BizTriageMessages, BizTriageMessagesVo> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.pet.mapper;
|
||||
|
||||
import org.dromara.pet.domain.BizTriageSessions;
|
||||
import org.dromara.pet.domain.vo.BizTriageSessionsVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* AI智能分诊会话Mapper接口
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
public interface BizTriageSessionsMapper extends BaseMapperPlus<BizTriageSessions, BizTriageSessionsVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.dromara.pet.service;
|
||||
|
||||
import org.dromara.pet.domain.vo.BizPetsVo;
|
||||
import org.dromara.pet.domain.bo.BizPetsBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宠物基础档案Service接口
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
public interface IBizPetsService {
|
||||
|
||||
/**
|
||||
* 查询宠物基础档案
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宠物基础档案
|
||||
*/
|
||||
BizPetsVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询宠物基础档案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宠物基础档案分页列表
|
||||
*/
|
||||
TableDataInfo<BizPetsVo> queryPageList(BizPetsBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的宠物基础档案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宠物基础档案列表
|
||||
*/
|
||||
List<BizPetsVo> queryList(BizPetsBo bo);
|
||||
|
||||
/**
|
||||
* 新增宠物基础档案
|
||||
*
|
||||
* @param bo 宠物基础档案
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BizPetsBo bo);
|
||||
|
||||
/**
|
||||
* 修改宠物基础档案
|
||||
*
|
||||
* @param bo 宠物基础档案
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BizPetsBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除宠物基础档案信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.pet.service;
|
||||
|
||||
import org.dromara.pet.domain.vo.BizTriageMessagesVo;
|
||||
import org.dromara.pet.domain.bo.BizTriageMessagesBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细Service接口
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
public interface IBizTriageMessagesService {
|
||||
|
||||
/**
|
||||
* 查询多模态问诊对话明细
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 多模态问诊对话明细
|
||||
*/
|
||||
BizTriageMessagesVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询多模态问诊对话明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 多模态问诊对话明细分页列表
|
||||
*/
|
||||
TableDataInfo<BizTriageMessagesVo> queryPageList(BizTriageMessagesBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的多模态问诊对话明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 多模态问诊对话明细列表
|
||||
*/
|
||||
List<BizTriageMessagesVo> queryList(BizTriageMessagesBo bo);
|
||||
|
||||
/**
|
||||
* 新增多模态问诊对话明细
|
||||
*
|
||||
* @param bo 多模态问诊对话明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BizTriageMessagesBo bo);
|
||||
|
||||
/**
|
||||
* 修改多模态问诊对话明细
|
||||
*
|
||||
* @param bo 多模态问诊对话明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BizTriageMessagesBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除多模态问诊对话明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.pet.service;
|
||||
|
||||
import org.dromara.pet.domain.vo.BizTriageSessionsVo;
|
||||
import org.dromara.pet.domain.bo.BizTriageSessionsBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI智能分诊会话Service接口
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
public interface IBizTriageSessionsService {
|
||||
|
||||
/**
|
||||
* 查询AI智能分诊会话
|
||||
*
|
||||
* @param id 主键
|
||||
* @return AI智能分诊会话
|
||||
*/
|
||||
BizTriageSessionsVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询AI智能分诊会话列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return AI智能分诊会话分页列表
|
||||
*/
|
||||
TableDataInfo<BizTriageSessionsVo> queryPageList(BizTriageSessionsBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的AI智能分诊会话列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return AI智能分诊会话列表
|
||||
*/
|
||||
List<BizTriageSessionsVo> queryList(BizTriageSessionsBo bo);
|
||||
|
||||
/**
|
||||
* 新增AI智能分诊会话
|
||||
*
|
||||
* @param bo AI智能分诊会话
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BizTriageSessionsBo bo);
|
||||
|
||||
/**
|
||||
* 修改AI智能分诊会话
|
||||
*
|
||||
* @param bo AI智能分诊会话
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BizTriageSessionsBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除AI智能分诊会话信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
package org.dromara.pet.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.pet.domain.bo.BizPetsBo;
|
||||
import org.dromara.pet.domain.vo.BizPetsVo;
|
||||
import org.dromara.pet.domain.BizPets;
|
||||
import org.dromara.pet.mapper.BizPetsMapper;
|
||||
import org.dromara.pet.service.IBizPetsService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 宠物基础档案Service业务层处理
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BizPetsServiceImpl implements IBizPetsService {
|
||||
|
||||
private final BizPetsMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询宠物基础档案
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 宠物基础档案
|
||||
*/
|
||||
@Override
|
||||
public BizPetsVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询宠物基础档案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 宠物基础档案分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BizPetsVo> queryPageList(BizPetsBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizPets> lqw = buildQueryWrapper(bo);
|
||||
Page<BizPetsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的宠物基础档案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 宠物基础档案列表
|
||||
*/
|
||||
@Override
|
||||
public List<BizPetsVo> queryList(BizPetsBo bo) {
|
||||
LambdaQueryWrapper<BizPets> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizPets> buildQueryWrapper(BizPetsBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BizPets> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BizPets::getId);
|
||||
lqw.eq(bo.getUserId() != null, BizPets::getUserId, bo.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BizPets::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecies()), BizPets::getSpecies, bo.getSpecies());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBreed()), BizPets::getBreed, bo.getBreed());
|
||||
lqw.eq(bo.getBirthDate() != null, BizPets::getBirthDate, bo.getBirthDate());
|
||||
lqw.eq(bo.getWeightKg() != null, BizPets::getWeightKg, bo.getWeightKg());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGender()), BizPets::getGender, bo.getGender());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsNeutered()), BizPets::getIsNeutered, bo.getIsNeutered());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAvatarUrl()), BizPets::getAvatarUrl, bo.getAvatarUrl());
|
||||
lqw.eq(bo.getCreatedAt() != null, BizPets::getCreatedAt, bo.getCreatedAt());
|
||||
lqw.eq(bo.getUpdatedAt() != null, BizPets::getUpdatedAt, bo.getUpdatedAt());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增宠物基础档案
|
||||
*
|
||||
* @param bo 宠物基础档案
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BizPetsBo bo) {
|
||||
BizPets add = MapstructUtils.convert(bo, BizPets. class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改宠物基础档案
|
||||
*
|
||||
* @param bo 宠物基础档案
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BizPetsBo bo) {
|
||||
BizPets update = MapstructUtils.convert(bo, BizPets. class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BizPets entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除宠物基础档案信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package org.dromara.pet.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.pet.domain.bo.BizTriageMessagesBo;
|
||||
import org.dromara.pet.domain.vo.BizTriageMessagesVo;
|
||||
import org.dromara.pet.domain.BizTriageMessages;
|
||||
import org.dromara.pet.mapper.BizTriageMessagesMapper;
|
||||
import org.dromara.pet.service.IBizTriageMessagesService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 多模态问诊对话明细Service业务层处理
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BizTriageMessagesServiceImpl implements IBizTriageMessagesService {
|
||||
|
||||
private final BizTriageMessagesMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询多模态问诊对话明细
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 多模态问诊对话明细
|
||||
*/
|
||||
@Override
|
||||
public BizTriageMessagesVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询多模态问诊对话明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 多模态问诊对话明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BizTriageMessagesVo> queryPageList(BizTriageMessagesBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizTriageMessages> lqw = buildQueryWrapper(bo);
|
||||
Page<BizTriageMessagesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的多模态问诊对话明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 多模态问诊对话明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<BizTriageMessagesVo> queryList(BizTriageMessagesBo bo) {
|
||||
LambdaQueryWrapper<BizTriageMessages> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizTriageMessages> buildQueryWrapper(BizTriageMessagesBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BizTriageMessages> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BizTriageMessages::getId);
|
||||
lqw.eq(bo.getSessionId() != null, BizTriageMessages::getSessionId, bo.getSessionId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSenderRole()), BizTriageMessages::getSenderRole, bo.getSenderRole());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMessageType()), BizTriageMessages::getMessageType, bo.getMessageType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), BizTriageMessages::getContent, bo.getContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMediaUrl()), BizTriageMessages::getMediaUrl, bo.getMediaUrl());
|
||||
lqw.eq(bo.getCreatedAt() != null, BizTriageMessages::getCreatedAt, bo.getCreatedAt());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增多模态问诊对话明细
|
||||
*
|
||||
* @param bo 多模态问诊对话明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BizTriageMessagesBo bo) {
|
||||
BizTriageMessages add = MapstructUtils.convert(bo, BizTriageMessages. class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改多模态问诊对话明细
|
||||
*
|
||||
* @param bo 多模态问诊对话明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BizTriageMessagesBo bo) {
|
||||
BizTriageMessages update = MapstructUtils.convert(bo, BizTriageMessages. class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BizTriageMessages entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除多模态问诊对话明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package org.dromara.pet.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.pet.domain.bo.BizTriageSessionsBo;
|
||||
import org.dromara.pet.domain.vo.BizTriageSessionsVo;
|
||||
import org.dromara.pet.domain.BizTriageSessions;
|
||||
import org.dromara.pet.mapper.BizTriageSessionsMapper;
|
||||
import org.dromara.pet.service.IBizTriageSessionsService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* AI智能分诊会话Service业务层处理
|
||||
*
|
||||
* @author shuo
|
||||
* @date 2026-02-26
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BizTriageSessionsServiceImpl implements IBizTriageSessionsService {
|
||||
|
||||
private final BizTriageSessionsMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询AI智能分诊会话
|
||||
*
|
||||
* @param id 主键
|
||||
* @return AI智能分诊会话
|
||||
*/
|
||||
@Override
|
||||
public BizTriageSessionsVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询AI智能分诊会话列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return AI智能分诊会话分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BizTriageSessionsVo> queryPageList(BizTriageSessionsBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BizTriageSessions> lqw = buildQueryWrapper(bo);
|
||||
Page<BizTriageSessionsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的AI智能分诊会话列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return AI智能分诊会话列表
|
||||
*/
|
||||
@Override
|
||||
public List<BizTriageSessionsVo> queryList(BizTriageSessionsBo bo) {
|
||||
LambdaQueryWrapper<BizTriageSessions> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizTriageSessions> buildQueryWrapper(BizTriageSessionsBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BizTriageSessions> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BizTriageSessions::getId);
|
||||
lqw.eq(bo.getUserId() != null, BizTriageSessions::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getPetId() != null, BizTriageSessions::getPetId, bo.getPetId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BizTriageSessions::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRiskLevel()), BizTriageSessions::getRiskLevel, bo.getRiskLevel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAiSummary()), BizTriageSessions::getAiSummary, bo.getAiSummary());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getActionPlan()), BizTriageSessions::getActionPlan, bo.getActionPlan());
|
||||
lqw.eq(bo.getCreatedAt() != null, BizTriageSessions::getCreatedAt, bo.getCreatedAt());
|
||||
lqw.eq(bo.getUpdatedAt() != null, BizTriageSessions::getUpdatedAt, bo.getUpdatedAt());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AI智能分诊会话
|
||||
*
|
||||
* @param bo AI智能分诊会话
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BizTriageSessionsBo bo) {
|
||||
BizTriageSessions add = MapstructUtils.convert(bo, BizTriageSessions. class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AI智能分诊会话
|
||||
*
|
||||
* @param bo AI智能分诊会话
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BizTriageSessionsBo bo) {
|
||||
BizTriageSessions update = MapstructUtils.convert(bo, BizTriageSessions. class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BizTriageSessions entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除AI智能分诊会话信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.pet.mapper.BizPetsMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.pet.mapper.BizTriageMessagesMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.pet.mapper.BizTriageSessionsMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user