@@ -0,0 +1,57 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 耗材和设备定义Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_activity_def_device_def")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ActivityDefDeviceDef extends HisBaseEntity {
|
||||
|
||||
/** $column.columnComment */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 测试定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/** 耗材id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long deviceDefinitionId;
|
||||
|
||||
/** 耗材名称 */
|
||||
private String deviceDefinitionName;
|
||||
|
||||
/** 仪器id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long instrumentId;
|
||||
|
||||
/** 仪器名称 */
|
||||
private String instrumentName;
|
||||
|
||||
/** 耗材使用数量 */
|
||||
private Integer deviceQuantity;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String activityDefinitionName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 观测指标定义Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_activity_def_observation_def")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ActivityDefObservationDef extends HisBaseEntity {
|
||||
|
||||
/** $column.columnComment */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Integer id;
|
||||
|
||||
/** 活动定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/** 活动名称 */
|
||||
private String activityDefinitionName;
|
||||
|
||||
/** 观测定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long observationDefinitionId;
|
||||
|
||||
/** 观测指标名称(如ALT、AST等) */
|
||||
private String observationName;
|
||||
|
||||
|
||||
/** 观测编码(如ALT、AST等) */
|
||||
private String observationCode;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 样本定义Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_activity_def_specimen_def")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ActivityDefSpecimenDef extends HisBaseEntity {
|
||||
|
||||
/** $column.columnComment */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Integer id;
|
||||
|
||||
/** 测试定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/** $column.columnComment */
|
||||
private String activityDefinitionName;
|
||||
|
||||
/** 测试定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long specimenDefinitionId;
|
||||
|
||||
/** 样本量 */
|
||||
private Integer specimenVolume;
|
||||
/** 样本名称 */
|
||||
private String specimenName;
|
||||
|
||||
/** 样本量单位 */
|
||||
private String specimenUnit;
|
||||
|
||||
/** 采样方法 */
|
||||
private String samplingMethod;
|
||||
|
||||
/** 删除状态,N为未删除,Y为已删除 */
|
||||
private String deleteFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 条码/标本流转表
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_barcode")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BarCode extends HisBaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
* 条码号
|
||||
*/
|
||||
@TableId(type = IdType.NONE)
|
||||
private String barcode;
|
||||
/**
|
||||
* 检验申请单号
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private String patientId;
|
||||
/**
|
||||
* 采样时间
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Date collectTime;
|
||||
/**
|
||||
* 采样人
|
||||
*/
|
||||
private String collectionEmp;
|
||||
/**
|
||||
* 送检时间
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Date sendTime;
|
||||
/**
|
||||
* 签收时间
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Date receiveTime;
|
||||
/**
|
||||
* 退检时间
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Date backFlag;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 检验申请单定义Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @Date 2026-01-27
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_apply")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class InspectionLabApply extends HisBaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID(自增)
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 申请单编号
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 患者主索引
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
/**
|
||||
* 就诊卡号
|
||||
*/
|
||||
private String medicalrecordNumber;
|
||||
/*
|
||||
* 费用性质
|
||||
*/
|
||||
private String natureofCost;
|
||||
/**
|
||||
* 门诊就诊流水号
|
||||
*/
|
||||
private String visitNo;
|
||||
/**
|
||||
* 开单科室编码
|
||||
*/
|
||||
private String applyDeptCode;
|
||||
/**
|
||||
* 申请科室名称
|
||||
*/
|
||||
private String applyDepartment;
|
||||
/**
|
||||
* 开单医生工号
|
||||
*/
|
||||
private String applyDocCode;
|
||||
/**
|
||||
* 申请医生名称
|
||||
*/
|
||||
private String applyDocName;
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Date applyTime;
|
||||
/**
|
||||
* 临床诊断
|
||||
*/
|
||||
private String clinicDiag;
|
||||
/**
|
||||
* 临床印象
|
||||
*/
|
||||
private String clinicDesc;
|
||||
/**
|
||||
* 禁忌症
|
||||
*/
|
||||
private String contraindication;
|
||||
/**
|
||||
* 病史摘要
|
||||
*/
|
||||
private String medicalHistorySummary;
|
||||
/**
|
||||
* 检验目的
|
||||
*/
|
||||
private String purposeofInspection;
|
||||
/**
|
||||
* 体格检查
|
||||
*/
|
||||
private String physicalExamination;
|
||||
/**
|
||||
* 检验项目
|
||||
*/
|
||||
private String inspectionItem;
|
||||
/**
|
||||
* 标本类型代码
|
||||
*/
|
||||
private String specimenTypeCode;
|
||||
/**
|
||||
* 标本名称
|
||||
*/
|
||||
private String specimenName;
|
||||
/**
|
||||
* 申请单优先级代码
|
||||
*/
|
||||
private String priorityCode;
|
||||
/**
|
||||
* 申请单状态
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long applyStatus;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String applyRemark;
|
||||
/**
|
||||
* 操作员工号
|
||||
*/
|
||||
private String operatorId;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 检验申请单明细表
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_apply_item")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class InspectionLabApplyItem extends HisBaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long itemId;
|
||||
/**
|
||||
* 申请单号
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 项目序号
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemSeq;
|
||||
/**
|
||||
* 项目代码
|
||||
*/
|
||||
private String itemCode;
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String itemName;
|
||||
/**
|
||||
* 国家平台项目代码
|
||||
*/
|
||||
private String nationalItemCode;
|
||||
/**
|
||||
* 执行科室代码
|
||||
*/
|
||||
private String performDeptCode;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal itemPrice;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal itemQty;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal itemAmount;
|
||||
/**
|
||||
* 行状态
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemStatus;
|
||||
/**
|
||||
* 套餐ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long feePackageId;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验套餐基本信息
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "inspection_basic_information", autoResultMap = true)
|
||||
public class InspectionPackage {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 套餐ID */
|
||||
@TableId(value = "basic_information_id", type = IdType.AUTO)
|
||||
@JsonProperty("packageId") // 保持向后兼容
|
||||
@JsonSerialize(using = ToStringSerializer.class) // 避免前端JS精度丢失
|
||||
private Long basicInformationId;
|
||||
|
||||
/**
|
||||
* 兼容前端常见主键字段名:id
|
||||
* - 输出:id = basicInformationId(字符串,避免 JS 精度丢失)
|
||||
* - 输入:允许前端传 id 回来时反序列化到 basicInformationId
|
||||
*/
|
||||
@JsonProperty("id")
|
||||
public String getId() {
|
||||
return basicInformationId == null ? null : String.valueOf(basicInformationId);
|
||||
}
|
||||
|
||||
@JsonProperty("id")
|
||||
public void setId(String id) {
|
||||
if (id == null || id.isBlank()) {
|
||||
return;
|
||||
}
|
||||
this.basicInformationId = Long.valueOf(id);
|
||||
}
|
||||
|
||||
/** 套餐类别,固定值:"检验套餐" */
|
||||
private String packageCategory;
|
||||
|
||||
/** 套餐级别:全院套餐/科室套餐/个人套餐 */
|
||||
private String packageLevel;
|
||||
|
||||
/** 套餐名称 */
|
||||
private String packageName;
|
||||
|
||||
/** 科室名称 */
|
||||
private String department;
|
||||
|
||||
/** 科室ID */
|
||||
private String departmentId;
|
||||
|
||||
/** 用户ID */
|
||||
private String userId;
|
||||
|
||||
/** 折扣百分比,默认0 */
|
||||
private BigDecimal discount;
|
||||
|
||||
/** 是否停用,默认false */
|
||||
@TableField("is_disabled")
|
||||
private Boolean isDisabled;
|
||||
|
||||
/** 显示套餐名,默认true */
|
||||
@TableField("show_package_name")
|
||||
private Boolean showPackageName;
|
||||
|
||||
/** 生成服务费,默认true */
|
||||
@TableField("generate_service_fee")
|
||||
private Boolean generateServiceFee;
|
||||
|
||||
/** 套餐价格启用,默认true */
|
||||
@TableField("enable_package_price")
|
||||
private Boolean enablePackagePrice;
|
||||
|
||||
/** 套餐金额,默认0.00 */
|
||||
private BigDecimal packageAmount;
|
||||
|
||||
/** 服务费,默认0.00 */
|
||||
private BigDecimal serviceFee;
|
||||
|
||||
/** LIS分组ID */
|
||||
private String lisGroup;
|
||||
|
||||
/** 血量 */
|
||||
private String bloodVolume;
|
||||
|
||||
/** 备注 */
|
||||
private String remarks;
|
||||
|
||||
/** 卫生机构名称 */
|
||||
private String orgName;
|
||||
|
||||
/** 制单人 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField("update_time")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/** 删除标志(false-正常,true-删除) */
|
||||
@TableLogic(value = "false", delval = "true")
|
||||
private Boolean delFlag;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验套餐明细
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "inspection_package_detail", autoResultMap = true)
|
||||
public class InspectionPackageDetail {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 明细ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String detailId;
|
||||
|
||||
/** 套餐ID */
|
||||
@JsonProperty("packageId") // 保持向后兼容
|
||||
@JsonSerialize(using = ToStringSerializer.class) // 避免前端JS精度丢失
|
||||
private Long basicInformationId;
|
||||
|
||||
/** 套餐名称 */
|
||||
private String packageName;
|
||||
|
||||
/** 项目名称 */
|
||||
private String itemName;
|
||||
|
||||
/** 剂量 */
|
||||
private String dosage;
|
||||
|
||||
/** 途径 */
|
||||
private String route;
|
||||
|
||||
/** 频次 */
|
||||
private String frequency;
|
||||
|
||||
/** 天数 */
|
||||
private Integer days;
|
||||
|
||||
/** 数量,默认1 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 单位 */
|
||||
private String unit;
|
||||
|
||||
/** 原始单价(未折扣前的价格,用于折扣变更时恢复原价) */
|
||||
private BigDecimal originalPrice;
|
||||
|
||||
/** 单价(折后单价 = 原始单价 × 折扣比例) */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 服务费,默认0.00 */
|
||||
private BigDecimal serviceFee;
|
||||
|
||||
/** 总金额 */
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 产地 */
|
||||
private String origin;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField("update_time")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/** 删除标志(false-正常,true-删除) */
|
||||
@TableField(value = "del_flag", fill = FieldFill.INSERT)
|
||||
@TableLogic(value = "false", delval = "true")
|
||||
private Boolean delFlag = false;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验类型
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "inspection_type", autoResultMap = true)
|
||||
public class InspectionType {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 检验类型编码 */
|
||||
private String code;
|
||||
|
||||
/** 检验类型名称 */
|
||||
private String name;
|
||||
|
||||
/** 所属科室 */
|
||||
private String department;
|
||||
|
||||
/** 父类ID(为空表示是大类,有值表示是子类) */
|
||||
@TableField("parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/** 排序 */
|
||||
@TableField("\"order\"")
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 有效标志(1:有效,0:无效) */
|
||||
@TableField("valid_flag")
|
||||
@TableLogic(value = "1", delval = "0")
|
||||
private Integer validFlag;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField("created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField("updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
/** 版本号 */
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 以下字段数据库表中不存在,用于禁用MyBatis Plus自动添加的字段
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String createBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String updateBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 检验项目定义实体(独立表 lab_activity_definition,不依赖 wor_activity_definition)
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_activity_definition")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LabActivityDefinition extends HisBaseEntity {
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 目录类别 */
|
||||
private String categoryCode;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
/** 项目名称拼音 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔拼音 */
|
||||
private String wbStr;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 使用单位 */
|
||||
private String permittedUnitCode;
|
||||
|
||||
/** 所属科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 医保标记 */
|
||||
private Integer ybFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 医保对码标记 */
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 身体部位 */
|
||||
private String bodySiteCode;
|
||||
|
||||
/** 所需标本 */
|
||||
private String specimenCode;
|
||||
|
||||
/** 说明 */
|
||||
private String descriptionText;
|
||||
|
||||
/** 规则id */
|
||||
private Integer ruleId;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 子项json */
|
||||
private String childrenJson;
|
||||
|
||||
/** 划价标记 */
|
||||
private Integer pricingFlag;
|
||||
|
||||
/** 序号 */
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceRange;
|
||||
|
||||
/** 检验类型ID(关联 inspection_type 大类,逻辑关联无外键) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inspectionTypeId;
|
||||
|
||||
/** 费用套餐ID(关联 inspection_basic_information,逻辑关联无外键) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long feePackageId;
|
||||
|
||||
/** 下级医技类型ID(关联 inspection_type 子类,逻辑关联无外键) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long subItemId;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_observation")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Observation extends HisBaseEntity {
|
||||
|
||||
/** 观察记录的唯一标识符 */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 患者ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 关联的样本ID */
|
||||
private Long specimenId;
|
||||
|
||||
/** 观察定义ID */
|
||||
private Long observationDefinitionId;
|
||||
|
||||
/** 观察结果,可能是文本描述或数值 */
|
||||
private String observationResult;
|
||||
|
||||
/** 观察的日期和时间 */
|
||||
private Date observationDate;
|
||||
|
||||
/** 执行观察的技术员ID */
|
||||
private Long technicianId;
|
||||
|
||||
/** 删除状态,默认为未删除 */
|
||||
private String deleteFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.openhis.lab.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
@TableName("lab_specimen")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Specimen extends HisBaseEntity {
|
||||
|
||||
/** 样本的唯一标识符 */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 与该样本相关的患者ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 与该样本相关的ENCounterID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 与该样本相关的申请服务id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 样本定义ID,对应 adm_specimen_definition 表的 id */
|
||||
private Long specimenDefinitionId;
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
/* 样本的采集日期和时间 */
|
||||
private Date collectionDate;
|
||||
|
||||
// private String chargeName; // 项目名称
|
||||
// private String specimenName; // 样本名称
|
||||
// private String doctorName; // 开单医生
|
||||
|
||||
private Integer specimenVolume; //样本量
|
||||
private String specimenUnit; //样本单位
|
||||
|
||||
/** 样本接收日期 */
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Date receivedDate;
|
||||
|
||||
/** 采集状态,默认为待采集 */
|
||||
private Integer collectionStatusEnum;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.ActivityDefDeviceDef;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 耗材和设备定义Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Repository
|
||||
public interface ActivityDefDeviceDefMapper extends BaseMapper<ActivityDefDeviceDef> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.ActivityDefObservationDef;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 观测指标定义Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Repository
|
||||
public interface ActivityDefObservationDefMapper extends BaseMapper<ActivityDefObservationDef> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.ActivityDefSpecimenDef;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 样本定义Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Repository
|
||||
public interface ActivityDefSpecimenDefMapper extends BaseMapper<ActivityDefSpecimenDef> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.InspectionLabApplyItem;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface InspectionLabApplyItemMapper extends BaseMapper<InspectionLabApplyItem> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.InspectionLabApply;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 检验申请单Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Repository
|
||||
public interface InspectionLabApplyMapper extends BaseMapper<InspectionLabApply> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.BarCode;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 条码Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Repository
|
||||
public interface InspectionLabBarCodeMapper extends BaseMapper<BarCode> {
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.InspectionPackageDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验套餐明细Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionPackageDetailMapper extends BaseMapper<InspectionPackageDetail> {
|
||||
|
||||
/**
|
||||
* 根据套餐ID批量删除明细数据
|
||||
* @param packageId 套餐ID
|
||||
* @return 删除的记录数
|
||||
*/
|
||||
int deleteByPackageId(Long packageId);
|
||||
|
||||
/**
|
||||
* 根据套餐ID查询明细列表
|
||||
* @param packageId 套餐ID
|
||||
* @return 明细列表
|
||||
*/
|
||||
List<InspectionPackageDetail> selectByPackageId(Long packageId);
|
||||
|
||||
/**
|
||||
* 批量插入明细数据
|
||||
* @param details 明细数据列表
|
||||
* @return 插入的记录数
|
||||
*/
|
||||
int batchInsert(List<InspectionPackageDetail> details);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.InspectionPackage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 检验套餐Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionPackageMapper extends BaseMapper<InspectionPackage> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 检验类型Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Repository
|
||||
public interface InspectionTypeMapper extends BaseMapper<InspectionType> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.LabActivityDefinition;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 检验项目定义 Mapper 接口
|
||||
*/
|
||||
@Repository
|
||||
public interface LabActivityDefinitionMapper extends BaseMapper<LabActivityDefinition> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.Observation;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Repository
|
||||
public interface ObservationMapper extends BaseMapper<Observation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.lab.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.Specimen;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SpecimenMapper extends BaseMapper<Specimen> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.ActivityDefDeviceDef;
|
||||
|
||||
/**
|
||||
* 耗材和设备定义Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
public interface IActivityDefDeviceDefService extends IService<ActivityDefDeviceDef> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.ActivityDefObservationDef;
|
||||
|
||||
/**
|
||||
* 观测指标定义Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
public interface IActivityDefObservationDefService extends IService<ActivityDefObservationDef> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.ActivityDefSpecimenDef;
|
||||
|
||||
/**
|
||||
* 样本定义Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
public interface IActivityDefSpecimenDefService extends IService<ActivityDefSpecimenDef> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.InspectionLabApplyItem;
|
||||
|
||||
/**
|
||||
* 检验申请单明细表
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
public interface IInspectionLabApplyItemService extends IService<InspectionLabApplyItem> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.InspectionLabApply;
|
||||
|
||||
/**
|
||||
* 检验申请单Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
public interface IInspectionLabApplyService extends IService<InspectionLabApply> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.BarCode;
|
||||
|
||||
/**
|
||||
* 检验申请单条码Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
public interface IInspectionLabBarCodeService extends IService<BarCode> {
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.InspectionPackageDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验套餐明细Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
public interface IInspectionPackageDetailService extends IService<InspectionPackageDetail> {
|
||||
|
||||
/**
|
||||
* 根据套餐ID查询明细列表
|
||||
* @param packageId 套餐ID
|
||||
* @return 明细列表
|
||||
*/
|
||||
List<InspectionPackageDetail> selectDetailsByPackageId(Long packageId);
|
||||
|
||||
/**
|
||||
* 批量保存明细数据
|
||||
* @param packageId 套餐ID
|
||||
* @param details 明细数据列表
|
||||
* @return 保存结果 {successCount: 成功数量, failCount: 失败数量}
|
||||
*/
|
||||
java.util.Map<String, Integer> batchSaveDetails(Long packageId, List<InspectionPackageDetail> details);
|
||||
|
||||
/**
|
||||
* 保存单个明细数据
|
||||
* @param detail 明细数据
|
||||
* @return 结果
|
||||
*/
|
||||
boolean saveDetail(InspectionPackageDetail detail);
|
||||
|
||||
/**
|
||||
* 批量删除明细数据
|
||||
* @param detailIds 明细ID数组
|
||||
* @return 删除数量
|
||||
*/
|
||||
int deleteDetails(List<String> detailIds);
|
||||
|
||||
/**
|
||||
* 根据套餐ID删除所有明细数据
|
||||
* @param packageId 套餐ID
|
||||
* @return 删除数量
|
||||
*/
|
||||
int deleteByPackageId(Long packageId);
|
||||
|
||||
/**
|
||||
* 计算明细数据的总金额和服务费
|
||||
* @param details 明细数据列表
|
||||
* @return {totalAmount: 总金额, totalServiceFee: 总服务费}
|
||||
*/
|
||||
java.util.Map<String, java.math.BigDecimal> calculateTotalAmount(List<InspectionPackageDetail> details);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.InspectionPackage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验套餐Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
public interface IInspectionPackageService extends IService<InspectionPackage> {
|
||||
|
||||
/**
|
||||
* 校验套餐名称唯一性
|
||||
* @param packageName 套餐名称
|
||||
* @param orgName 机构名称
|
||||
* @param excludeId 排除的ID(用于更新时)
|
||||
* @return true-唯一,false-不唯一
|
||||
*/
|
||||
boolean checkPackageNameUnique(String packageName, String orgName, Long excludeId);
|
||||
|
||||
/**
|
||||
* 根据条件查询套餐列表(分页)
|
||||
* @param inspectionPackage 查询条件
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页数量
|
||||
* @return 套餐列表
|
||||
*/
|
||||
List<InspectionPackage> selectPackageList(InspectionPackage inspectionPackage, Integer pageNum, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据套餐ID查询套餐详情
|
||||
* @param packageId 套餐ID
|
||||
* @return 套餐信息
|
||||
*/
|
||||
InspectionPackage selectPackageById(Long packageId);
|
||||
|
||||
/**
|
||||
* 新增检验套餐
|
||||
* @param inspectionPackage 套餐信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean insertPackage(InspectionPackage inspectionPackage);
|
||||
|
||||
/**
|
||||
* 修改检验套餐
|
||||
* @param inspectionPackage 套餐信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean updatePackage(InspectionPackage inspectionPackage);
|
||||
|
||||
/**
|
||||
* 删除检验套餐
|
||||
* @param packageId 套餐ID
|
||||
* @return 结果
|
||||
*/
|
||||
boolean deletePackage(Long packageId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
|
||||
/**
|
||||
* 检验类型Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface IInspectionTypeService extends IService<InspectionType> {
|
||||
|
||||
/**
|
||||
* 分页查询检验类型列表
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 每页数量
|
||||
* @param searchKey 搜索关键词(可选)
|
||||
* @return 分页结果
|
||||
*/
|
||||
IPage<InspectionType> getPage(Integer pageNo, Integer pageSize, String searchKey);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.LabActivityDefinition;
|
||||
|
||||
/**
|
||||
* 检验项目定义 Service 接口
|
||||
*/
|
||||
public interface ILabActivityDefinitionService extends IService<LabActivityDefinition> {
|
||||
|
||||
/**
|
||||
* 新增检验项目
|
||||
*
|
||||
* @param labActivityDefinition 检验项目实体
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean addLabActivityDefinition(LabActivityDefinition labActivityDefinition);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.Observation;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
public interface IObservationService extends IService<Observation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.Specimen;
|
||||
|
||||
/**
|
||||
* Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
public interface ISpecimenService extends IService<Specimen> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.ActivityDefDeviceDef;
|
||||
import com.openhis.lab.mapper.ActivityDefDeviceDefMapper;
|
||||
import com.openhis.lab.service.IActivityDefDeviceDefService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 耗材和设备定义Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Service
|
||||
public class ActivityDefDeviceDefServiceImpl extends ServiceImpl<ActivityDefDeviceDefMapper, ActivityDefDeviceDef> implements IActivityDefDeviceDefService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.ActivityDefObservationDef;
|
||||
import com.openhis.lab.mapper.ActivityDefObservationDefMapper;
|
||||
import com.openhis.lab.service.IActivityDefObservationDefService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 观测指标定义Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Service
|
||||
public class ActivityDefObservationDefServiceImpl extends ServiceImpl<ActivityDefObservationDefMapper, ActivityDefObservationDef> implements IActivityDefObservationDefService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.ActivityDefSpecimenDef;
|
||||
import com.openhis.lab.mapper.ActivityDefSpecimenDefMapper;
|
||||
import com.openhis.lab.service.IActivityDefSpecimenDefService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 样本定义Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Service
|
||||
public class ActivityDefSpecimenDefServiceImpl extends ServiceImpl<ActivityDefSpecimenDefMapper, ActivityDefSpecimenDef> implements IActivityDefSpecimenDefService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.InspectionLabApplyItem;
|
||||
import com.openhis.lab.mapper.InspectionLabApplyItemMapper;
|
||||
import com.openhis.lab.service.IInspectionLabApplyItemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class InspectionLabApplyItemServiceImpl extends ServiceImpl<InspectionLabApplyItemMapper, InspectionLabApplyItem>
|
||||
implements IInspectionLabApplyItemService
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.InspectionLabApply;
|
||||
import com.openhis.lab.mapper.InspectionLabApplyMapper;
|
||||
import com.openhis.lab.service.IInspectionLabApplyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class InspectionLabApplyServiceImpl extends ServiceImpl<InspectionLabApplyMapper, InspectionLabApply>
|
||||
implements IInspectionLabApplyService{
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.BarCode;
|
||||
import com.openhis.lab.mapper.InspectionLabBarCodeMapper;
|
||||
import com.openhis.lab.service.IInspectionLabBarCodeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 检验申请单条码Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Service
|
||||
public class InspectionLabBarCodeServiceImpl extends ServiceImpl<InspectionLabBarCodeMapper, BarCode>
|
||||
implements IInspectionLabBarCodeService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.InspectionPackageDetail;
|
||||
import com.openhis.lab.mapper.InspectionPackageDetailMapper;
|
||||
import com.openhis.lab.service.IInspectionPackageDetailService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检验套餐明细Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InspectionPackageDetailServiceImpl extends ServiceImpl<InspectionPackageDetailMapper, InspectionPackageDetail> implements IInspectionPackageDetailService {
|
||||
|
||||
@Override
|
||||
public List<InspectionPackageDetail> selectDetailsByPackageId(Long packageId) {
|
||||
return this.baseMapper.selectByPackageId(packageId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Integer> batchSaveDetails(Long packageId, List<InspectionPackageDetail> details) {
|
||||
Map<String, Integer> result = new HashMap<>();
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
|
||||
try {
|
||||
// 1. 先删除该套餐下的所有旧明细数据
|
||||
int deletedCount = this.baseMapper.deleteByPackageId(packageId);
|
||||
log.info("删除套餐{}的旧明细数据{}条", packageId, deletedCount);
|
||||
|
||||
// 2. 批量插入新的明细数据
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
// 设置套餐ID和创建时间
|
||||
for (InspectionPackageDetail detail : details) {
|
||||
detail.setBasicInformationId(packageId);
|
||||
detail.setCreateTime(LocalDateTime.now());
|
||||
detail.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
// 设置默认值
|
||||
if (detail.getQuantity() == null) {
|
||||
detail.setQuantity(1);
|
||||
}
|
||||
if (detail.getServiceFee() == null) {
|
||||
detail.setServiceFee(BigDecimal.ZERO);
|
||||
}
|
||||
if (detail.getTotalAmount() == null) {
|
||||
// 计算总金额 = 金额 + 服务费
|
||||
BigDecimal totalAmount = detail.getAmount() != null ? detail.getAmount() : BigDecimal.ZERO;
|
||||
totalAmount = totalAmount.add(detail.getServiceFee());
|
||||
detail.setTotalAmount(totalAmount);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量插入
|
||||
int insertedCount = this.baseMapper.batchInsert(details);
|
||||
successCount = insertedCount;
|
||||
log.info("批量插入套餐{}的新明细数据{}条", packageId, insertedCount);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("批量保存明细数据失败:packageId={}, error={}", packageId, e.getMessage(), e);
|
||||
failCount = details != null ? details.size() : 0;
|
||||
throw e; // 让事务回滚
|
||||
}
|
||||
|
||||
result.put("successCount", successCount);
|
||||
result.put("failCount", failCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveDetail(InspectionPackageDetail detail) {
|
||||
// 设置默认值
|
||||
if (detail.getQuantity() == null) {
|
||||
detail.setQuantity(1);
|
||||
}
|
||||
if (detail.getServiceFee() == null) {
|
||||
detail.setServiceFee(BigDecimal.ZERO);
|
||||
}
|
||||
if (detail.getTotalAmount() == null) {
|
||||
// 计算总金额 = 金额 + 服务费
|
||||
BigDecimal totalAmount = detail.getAmount() != null ? detail.getAmount() : BigDecimal.ZERO;
|
||||
totalAmount = totalAmount.add(detail.getServiceFee());
|
||||
detail.setTotalAmount(totalAmount);
|
||||
}
|
||||
|
||||
detail.setCreateTime(LocalDateTime.now());
|
||||
detail.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
return this.save(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDetails(List<String> detailIds) {
|
||||
if (CollectionUtils.isEmpty(detailIds)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 逻辑删除
|
||||
return this.baseMapper.deleteBatchIds(detailIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPackageId(Long packageId) {
|
||||
return this.baseMapper.deleteByPackageId(packageId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, BigDecimal> calculateTotalAmount(List<InspectionPackageDetail> details) {
|
||||
Map<String, BigDecimal> result = new HashMap<>();
|
||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
BigDecimal totalServiceFee = BigDecimal.ZERO;
|
||||
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (InspectionPackageDetail detail : details) {
|
||||
if (detail.getAmount() != null) {
|
||||
totalAmount = totalAmount.add(detail.getAmount());
|
||||
}
|
||||
if (detail.getServiceFee() != null) {
|
||||
totalServiceFee = totalServiceFee.add(detail.getServiceFee());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.put("totalAmount", totalAmount);
|
||||
result.put("totalServiceFee", totalServiceFee);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.InspectionPackage;
|
||||
import com.openhis.lab.mapper.InspectionPackageMapper;
|
||||
import com.openhis.lab.service.IInspectionPackageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验套餐Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-25
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InspectionPackageServiceImpl extends ServiceImpl<InspectionPackageMapper, InspectionPackage> implements IInspectionPackageService {
|
||||
|
||||
@Override
|
||||
public boolean checkPackageNameUnique(String packageName, String orgName, Long excludeId) {
|
||||
QueryWrapper<InspectionPackage> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("package_name", packageName)
|
||||
.eq("org_name", orgName)
|
||||
.eq("del_flag", false);
|
||||
if (excludeId != null) {
|
||||
queryWrapper.ne("basic_information_id", excludeId);
|
||||
}
|
||||
return this.count(queryWrapper) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InspectionPackage> selectPackageList(InspectionPackage inspectionPackage, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<InspectionPackage> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
// 构建查询条件
|
||||
if (StringUtils.hasText(inspectionPackage.getPackageName())) {
|
||||
queryWrapper.like("package_name", inspectionPackage.getPackageName());
|
||||
}
|
||||
if (StringUtils.hasText(inspectionPackage.getPackageLevel())) {
|
||||
queryWrapper.eq("package_level", inspectionPackage.getPackageLevel());
|
||||
}
|
||||
if (inspectionPackage.getIsDisabled() != null) {
|
||||
queryWrapper.eq("is_disabled", inspectionPackage.getIsDisabled());
|
||||
}
|
||||
if (StringUtils.hasText(inspectionPackage.getDepartment())) {
|
||||
queryWrapper.eq("department", inspectionPackage.getDepartment());
|
||||
}
|
||||
if (StringUtils.hasText(inspectionPackage.getPackageCategory())) {
|
||||
queryWrapper.eq("package_category", inspectionPackage.getPackageCategory());
|
||||
}
|
||||
|
||||
// 默认只查询未删除的记录
|
||||
queryWrapper.eq("del_flag", false);
|
||||
|
||||
// 排序
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
if (pageNum != null && pageSize != null) {
|
||||
Page<InspectionPackage> page = new Page<>(pageNum, pageSize);
|
||||
Page<InspectionPackage> resultPage = this.page(page, queryWrapper);
|
||||
// 将Page对象存储到ThreadLocal中,以便Controller获取total
|
||||
return resultPage.getRecords();
|
||||
} else {
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InspectionPackage selectPackageById(Long packageId) {
|
||||
return this.getById(packageId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertPackage(InspectionPackage inspectionPackage) {
|
||||
// 设置默认值
|
||||
if (inspectionPackage.getDiscount() == null) {
|
||||
inspectionPackage.setDiscount(java.math.BigDecimal.ZERO);
|
||||
}
|
||||
if (inspectionPackage.getIsDisabled() == null) {
|
||||
inspectionPackage.setIsDisabled(false);
|
||||
}
|
||||
if (inspectionPackage.getShowPackageName() == null) {
|
||||
inspectionPackage.setShowPackageName(true);
|
||||
}
|
||||
if (inspectionPackage.getGenerateServiceFee() == null) {
|
||||
inspectionPackage.setGenerateServiceFee(true);
|
||||
}
|
||||
if (inspectionPackage.getEnablePackagePrice() == null) {
|
||||
inspectionPackage.setEnablePackagePrice(true);
|
||||
}
|
||||
if (inspectionPackage.getPackageAmount() == null) {
|
||||
inspectionPackage.setPackageAmount(java.math.BigDecimal.ZERO);
|
||||
}
|
||||
if (inspectionPackage.getServiceFee() == null) {
|
||||
inspectionPackage.setServiceFee(java.math.BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
// 设置创建时间
|
||||
inspectionPackage.setCreateTime(LocalDateTime.now());
|
||||
inspectionPackage.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
return this.save(inspectionPackage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updatePackage(InspectionPackage inspectionPackage) {
|
||||
// 设置更新时间
|
||||
inspectionPackage.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
return this.updateById(inspectionPackage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deletePackage(Long packageId) {
|
||||
// 逻辑删除
|
||||
InspectionPackage inspectionPackage = new InspectionPackage();
|
||||
inspectionPackage.setBasicInformationId(packageId);
|
||||
inspectionPackage.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
return this.removeById(packageId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
import com.openhis.lab.mapper.InspectionTypeMapper;
|
||||
import com.openhis.lab.service.IInspectionTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 检验类型Service实现类
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Service
|
||||
public class InspectionTypeServiceImpl extends ServiceImpl<InspectionTypeMapper, InspectionType> implements IInspectionTypeService {
|
||||
|
||||
@Override
|
||||
public IPage<InspectionType> getPage(Integer pageNo, Integer pageSize, String searchKey) {
|
||||
Page<InspectionType> page = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<InspectionType> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 搜索关键词(按编码或名称模糊查询)
|
||||
if (StringUtils.hasText(searchKey)) {
|
||||
queryWrapper.and(wrapper -> wrapper
|
||||
.like(InspectionType::getCode, searchKey)
|
||||
.or()
|
||||
.like(InspectionType::getName, searchKey));
|
||||
}
|
||||
|
||||
// 按排序字段升序排列
|
||||
queryWrapper.orderByAsc(InspectionType::getSortOrder);
|
||||
|
||||
return this.page(page, queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.lab.domain.LabActivityDefinition;
|
||||
import com.openhis.lab.mapper.LabActivityDefinitionMapper;
|
||||
import com.openhis.lab.service.ILabActivityDefinitionService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检验项目定义 Service 实现类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class LabActivityDefinitionServiceImpl
|
||||
extends ServiceImpl<LabActivityDefinitionMapper, LabActivityDefinition>
|
||||
implements ILabActivityDefinitionService {
|
||||
|
||||
/**
|
||||
* 新增检验项目(检查编码唯一性)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addLabActivityDefinition(LabActivityDefinition labActivityDefinition) {
|
||||
// 根据编码判断是否已存在
|
||||
List<LabActivityDefinition> existing = baseMapper.selectList(
|
||||
new LambdaQueryWrapper<LabActivityDefinition>()
|
||||
.eq(LabActivityDefinition::getBusNo, labActivityDefinition.getBusNo()));
|
||||
if (!existing.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
setRequiredFields(labActivityDefinition);
|
||||
return baseMapper.insert(labActivityDefinition) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 补全必填字段(create_by、tenant_id、create_time)
|
||||
*/
|
||||
private void setRequiredFields(LabActivityDefinition entity) {
|
||||
String createBy = "system";
|
||||
Integer tenantId = 1;
|
||||
try {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
createBy = loginUser.getUsername();
|
||||
tenantId = loginUser.getTenantId() != null ? loginUser.getTenantId() : 1;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
entity.setCreateBy(createBy);
|
||||
entity.setTenantId(tenantId);
|
||||
if (entity.getCreateTime() == null) {
|
||||
entity.setCreateTime(new Date());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.Observation;
|
||||
import com.openhis.lab.mapper.ObservationMapper;
|
||||
import com.openhis.lab.service.IObservationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Service
|
||||
public class ObservationServiceImpl extends ServiceImpl<ObservationMapper, Observation> implements IObservationService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.Specimen;
|
||||
import com.openhis.lab.mapper.SpecimenMapper;
|
||||
import com.openhis.lab.service.ISpecimenService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Service
|
||||
public class SpecimenServiceImpl extends ServiceImpl<SpecimenMapper, Specimen> implements ISpecimenService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user