HuRongxin 3 месяцев назад
Родитель
Сommit
dfc3f46a36

+ 105 - 0
ruoyi-admin/src/main/java/org/dromara/web/controller/TreatmentUserController.java

@@ -0,0 +1,105 @@
+package org.dromara.web.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.dromara.web.domain.bo.TreatmentUserBo;
+import org.dromara.web.domain.vo.TreatmentUserVo;
+import org.dromara.web.service.ITreatmentUserService;
+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.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 【工作台 待诊患者】
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/workbench/treatmentUser")
+public class TreatmentUserController extends BaseController {
+
+    private final ITreatmentUserService treatmentUserService;
+
+    /**
+     * 查询【待诊患者】列表
+     */
+    @SaCheckPermission("workbench:treatmentUser:list")
+    @GetMapping("/list")
+    public TableDataInfo<TreatmentUserVo> list(TreatmentUserBo bo, PageQuery pageQuery) {
+        return treatmentUserService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出【待诊患者】列表
+     */
+    @SaCheckPermission("workbench:treatmentUser:export")
+    @Log(title = "【待诊患者】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(TreatmentUserBo bo, HttpServletResponse response) {
+        List<TreatmentUserVo> list = treatmentUserService.queryList(bo);
+        ExcelUtil.exportExcel(list, "【待诊患者】", TreatmentUserVo.class, response);
+    }
+
+    /**
+     * 获取【待诊患者】详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("workbench:treatmentUser:query")
+    @GetMapping("/{id}")
+    public R<TreatmentUserVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(treatmentUserService.queryById(id));
+    }
+
+    /**
+     * 新增【待诊患者】
+     */
+    @SaCheckPermission("workbench:treatmentUser:add")
+    @Log(title = "【待诊患者】", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody TreatmentUserBo bo) {
+        return toAjax(treatmentUserService.insertByBo(bo));
+    }
+
+    /**
+     * 修改【待诊患者】
+     */
+    @SaCheckPermission("workbench:treatmentUser:edit")
+    @Log(title = "【待诊患者】", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody TreatmentUserBo bo) {
+        return toAjax(treatmentUserService.updateByBo(bo));
+    }
+
+    /**
+     * 删除【待诊患者】
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("workbench:treatmentUser:remove")
+    @Log(title = "【待诊患者】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(treatmentUserService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 118 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/TreatmentUser.java

@@ -0,0 +1,118 @@
+package org.dromara.web.domain;
+
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+
+/**
+ * 【待诊患者】对象 treatment_user
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("treatment_user")
+public class TreatmentUser extends BaseEntity {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 看诊类型
+     */
+    private String type;
+
+    /**
+     * 诊疗卡号
+     */
+    private String treatNum;
+
+    /**
+     * 门诊号
+     */
+    private String outpatientNo;
+
+    /**
+     * 科室
+     */
+    private Long doorId;
+
+    /**
+     * 姓名
+     */
+    private String treatName;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 身高
+     */
+    private String height;
+
+    /**
+     * 体重
+     */
+    private String weight;
+
+    /**
+     * 过敏食物
+     */
+    private String allergyFoot;
+
+
+    /**
+     * 过敏药物
+     */
+    private String allergyDrug;
+
+    /**
+     * 体力活动
+     */
+    private String activity;
+
+    /**
+     * 诊断状态
+     */
+    private String medicalType;
+
+    /**
+     * 删除标记
+     */
+    @TableLogic
+    private String delFlag;
+
+    /**
+     * 患者状态
+     */
+    private String treatmentUserStatus;
+
+    /**
+     * 评估状态
+     */
+    private String evaluationStatus;
+
+
+}

+ 139 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/bo/TreatmentUserBo.java

@@ -0,0 +1,139 @@
+package org.dromara.web.domain.bo;
+
+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 org.dromara.web.domain.TreatmentUser;
+
+import java.util.Date;
+
+/**
+ * 【请填写功能名称】业务对象 treatment_user
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = TreatmentUser.class, reverseConvertGenerate = false)
+public class TreatmentUserBo extends BaseEntity {
+
+    /**
+     *
+     */
+    @NotNull(message = "不能为空", groups = { EditGroup.class })
+    private Long id;
+
+    /**
+     * 看诊类型
+     */
+    private String type;
+
+    /**
+     * 诊疗卡号
+     */
+    private String treatNum;
+
+    /**
+     * 门诊号
+     */
+    private String outpatientNo;
+
+    /**
+     * 科室
+     */
+    private Long doorId;
+
+    /**
+     * 姓名
+     */
+    private String treatName;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 联系电话
+     */
+    private String phoneNum;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 身高
+     */
+    private String height;
+
+    /**
+     * 体重
+     */
+    private String weight;
+
+    /**
+     * 过敏食物
+     */
+    private String allergyFoot;
+
+    /**
+     * 过敏药物
+     */
+    private String allergyDrug;
+
+    /**
+     * 体力活动
+     */
+    private String activity;
+
+    /**
+     * 床号
+     */
+    private String bedNo;
+
+    /**
+     * 病区
+     */
+    private String inpatientWard;
+
+    /**
+     * 入院时间
+     */
+    private Date admissionDate;
+
+    /*查询字段*/
+
+    private String searchFlag;
+
+    /**
+     * 诊断状态
+     */
+    private String medicalType;
+
+    /**
+     * 患者状态
+     */
+    private String treatmentUserStatus;
+
+    /**
+     * 评估状态
+     */
+    private String evaluationStatus;
+}

+ 161 - 0
ruoyi-admin/src/main/java/org/dromara/web/domain/vo/TreatmentUserVo.java

@@ -0,0 +1,161 @@
+package org.dromara.web.domain.vo;
+
+
+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 org.dromara.web.domain.TreatmentUser;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+ * 【请填写功能名称】视图对象 treatment_user
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = TreatmentUser.class)
+public class TreatmentUserVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @ExcelProperty(value = "")
+    private Long id;
+
+    /**
+     * 看诊类型
+     */
+    @ExcelProperty(value = "看诊类型")
+    private String type;
+
+    /**
+     * 诊疗卡号
+     */
+    @ExcelProperty(value = "诊疗卡号")
+    private String treatNum;
+
+    /**
+     * 门诊号
+     */
+    @ExcelProperty(value = "门诊号")
+    private String outpatientNo;
+
+    /**
+     * 科室
+     */
+    @ExcelProperty(value = "科室")
+    private Long doorId;
+
+    /**
+     * 姓名
+     */
+    @ExcelProperty(value = "姓名")
+    private String treatName;
+
+    /**
+     * 出生日期
+     */
+    @ExcelProperty(value = "出生日期")
+    private String birthday;
+
+    /**
+     * 联系电话
+     */
+    @ExcelProperty(value = "联系电话")
+    private String phoneNum;
+
+    /**
+     * 性别
+     */
+    @ExcelProperty(value = "性别 ")
+    private String sex;
+
+    /**
+     * 身份证号
+     */
+    @ExcelProperty(value = "身份证号")
+    private String idCard;
+
+    /**
+     * 年龄
+     */
+    @ExcelProperty(value = "年龄")
+    private String age;
+
+    /**
+     * 身高
+     */
+    @ExcelProperty(value = "身高")
+    private String height;
+
+    /**
+     * 体重
+     */
+    @ExcelProperty(value = "体重")
+    private String weight;
+
+    /**
+     * 过敏食物
+     */
+    @ExcelProperty(value = "过敏食物")
+    private String allergyFoot;
+
+    /**
+     * 过敏药物
+     */
+    @ExcelProperty(value = "过敏药物")
+    private String allergyDrug;
+
+    /**
+     * 体力活动
+     */
+    @ExcelProperty(value = "体力活动")
+    private String activity;
+
+    /**
+     * 床号
+     */
+    @ExcelProperty(value = "床号")
+    private String bedNo;
+
+    /**
+     * 病区
+     */
+    @ExcelProperty(value = "病区")
+    private String inpatientWard;
+
+    /**
+     * 入院时间
+     */
+    @ExcelProperty(value = "入院时间")
+    private Date admissionDate;
+
+    /**
+     * 诊断状态
+     */
+    private String medicalType;
+
+    /**
+     * 患者状态
+     */
+    private String treatmentUserStatus;
+
+    /**
+     * 评估状态
+     */
+    private String evaluationStatus;
+
+}

+ 16 - 0
ruoyi-admin/src/main/java/org/dromara/web/mapper/TreatmentUserMapper.java

@@ -0,0 +1,16 @@
+package org.dromara.web.mapper;
+
+
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+import org.dromara.web.domain.TreatmentUser;
+import org.dromara.web.domain.vo.TreatmentUserVo;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+public interface TreatmentUserMapper extends BaseMapperPlus<TreatmentUser, TreatmentUserVo> {
+
+}

+ 69 - 0
ruoyi-admin/src/main/java/org/dromara/web/service/ITreatmentUserService.java

@@ -0,0 +1,69 @@
+package org.dromara.web.service;
+
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.web.domain.bo.TreatmentUserBo;
+import org.dromara.web.domain.vo.TreatmentUserVo;
+
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+public interface ITreatmentUserService {
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 主键
+     * @return 【请填写功能名称】
+     */
+    TreatmentUserVo queryById(Long id);
+
+    /**
+     * 分页查询【请填写功能名称】列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 【请填写功能名称】分页列表
+     */
+    TableDataInfo<TreatmentUserVo> queryPageList(TreatmentUserBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的【请填写功能名称】列表
+     *
+     * @param bo 查询条件
+     * @return 【请填写功能名称】列表
+     */
+    List<TreatmentUserVo> queryList(TreatmentUserBo bo);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(TreatmentUserBo bo);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(TreatmentUserBo bo);
+
+    /**
+     * 校验并批量删除【请填写功能名称】信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 149 - 0
ruoyi-admin/src/main/java/org/dromara/web/service/impl/TreatmentUserServiceImpl.java

@@ -0,0 +1,149 @@
+package org.dromara.web.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+import org.dromara.web.domain.TreatmentUser;
+import org.dromara.web.domain.bo.TreatmentUserBo;
+import org.dromara.web.domain.vo.TreatmentUserVo;
+import org.dromara.web.mapper.TreatmentUserMapper;
+import org.dromara.web.service.ITreatmentUserService;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author Lion Li
+ * @date 2025-06-24
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class TreatmentUserServiceImpl implements ITreatmentUserService {
+
+    private final TreatmentUserMapper baseMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public TreatmentUserVo queryById(Long id) {
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询【请填写功能名称】列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 【请填写功能名称】分页列表
+     */
+    @Override
+    public TableDataInfo<TreatmentUserVo> queryPageList(TreatmentUserBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<TreatmentUser> lqw = buildQueryWrapper(bo);
+        Page<TreatmentUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的【请填写功能名称】列表
+     *
+     * @param bo 查询条件
+     * @return 【请填写功能名称】列表
+     */
+    @Override
+    public List<TreatmentUserVo> queryList(TreatmentUserBo bo) {
+        LambdaQueryWrapper<TreatmentUser> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<TreatmentUser> buildQueryWrapper(TreatmentUserBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<TreatmentUser> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(TreatmentUser::getId);
+        lqw.eq(StringUtils.isNotBlank(bo.getType()), TreatmentUser::getType, bo.getType());
+        lqw.eq(bo.getDoorId() != null, TreatmentUser::getDoorId, bo.getDoorId());
+        lqw.eq(bo.getEvaluationStatus() != null, TreatmentUser::getEvaluationStatus, bo.getEvaluationStatus());
+        lqw.eq(bo.getTreatmentUserStatus() != null, TreatmentUser::getTreatmentUserStatus, bo.getTreatmentUserStatus());
+        lqw.eq(StringUtils.isNotBlank(bo.getTreatNum()), TreatmentUser::getTreatNum, bo.getTreatNum());
+        lqw.eq(StringUtils.isNotBlank(bo.getOutpatientNo()), TreatmentUser::getOutpatientNo, bo.getOutpatientNo());
+        // 添加searchFlag的多字段模糊查询
+        if (StringUtils.isNotBlank(bo.getSearchFlag())) {
+            lqw.and(wrapper ->
+                wrapper.like(TreatmentUser::getTreatName, bo.getSearchFlag())
+                    .or()
+                    .like(TreatmentUser::getOutpatientNo, bo.getSearchFlag())
+                    .or()
+                    .like(TreatmentUser::getIdCard, bo.getSearchFlag())
+                    .or()
+                    .like(TreatmentUser::getOutpatientNo, bo.getSearchFlag()));
+        }
+        return lqw;
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(TreatmentUserBo bo) {
+        TreatmentUser add = MapstructUtils.convert(bo, TreatmentUser.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(TreatmentUserBo bo) {
+        TreatmentUser update = MapstructUtils.convert(bo, TreatmentUser.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(TreatmentUser entity) {
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除【请填写功能名称】信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if (isValid) {
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+}

+ 7 - 0
ruoyi-admin/src/main/resources/mapper/workbench/TreatmentUserMapper.xml

@@ -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.web.mapper.TreatmentUserMapper">
+
+</mapper>