Fix Bug #550: AI修复
This commit is contained in:
@@ -1,105 +0,0 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_activity_definition")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ActivityDefinition extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 目录类别 */
|
||||
private String categoryCode;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
/** 项目名称拼音 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔拼音 */
|
||||
private String wbStr;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 使用单位 */
|
||||
private String permittedUnitCode;
|
||||
|
||||
/** 所属科室 */
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
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 表,parent_id 为空的大类) */
|
||||
private Long inspectionTypeId;
|
||||
|
||||
/** 费用套餐ID(关联 inspection_basic_information 表) */
|
||||
private Long feePackageId;
|
||||
|
||||
/** 下级医技类型ID(关联 inspection_type 表,parent_id 不为空的子类) */
|
||||
private Long subItemId;
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package com.openhis.workflow.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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 器材发放管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_device_dispense")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class DeviceDispense extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 器材发放id */
|
||||
private String busNo;
|
||||
|
||||
/** 器材请求id */
|
||||
private Long deviceReqId;
|
||||
|
||||
/** 器材发放状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
// 暂时不要用
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
// 暂时不要用
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
/** 未发药原因 */
|
||||
private Integer notPerformedReasonEnum;
|
||||
|
||||
/** 发药类型 */
|
||||
private Integer dispenseCategoryEnum;
|
||||
|
||||
/** 发放数量 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 发放单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 器材编码 */
|
||||
private Long deviceDefId;
|
||||
|
||||
/** 领药患者 */
|
||||
private Long patientId;
|
||||
|
||||
/** 相关诊疗 */
|
||||
private Long encounterId;
|
||||
|
||||
/** 发药人 */
|
||||
private Long performerId;
|
||||
|
||||
/** 发放器材房 */
|
||||
private Long locationId;
|
||||
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
/** 发药类型 */
|
||||
private String partTypeCode;
|
||||
|
||||
/** 已发药数量 */
|
||||
private BigDecimal dispenseQuantity;
|
||||
|
||||
/** 发药频次 */
|
||||
private String dispenseFrequencyCode;
|
||||
|
||||
/** 配药人 */
|
||||
private Long preparerId;
|
||||
|
||||
/** 配药时间 */
|
||||
private Date prepareTime;
|
||||
|
||||
/** 发药时间 */
|
||||
private Date dispenseTime;
|
||||
|
||||
/** 限制发药时间 */
|
||||
private Date limitTime;
|
||||
|
||||
/** 预定发药时间 */
|
||||
private Date plannedDispenseTime;
|
||||
|
||||
/** 发药目的地 */
|
||||
private String desLocationId;
|
||||
|
||||
/** 接收人 */
|
||||
private String recPractitionerId;
|
||||
|
||||
/** 使用说明 */
|
||||
private String usageInstruction;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 执行id */
|
||||
private Long procedureId;
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
package com.openhis.workflow.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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 器材请求管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_device_request")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class DeviceRequest extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 器材请求编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 相关诊疗项目 */
|
||||
private Long activityId;
|
||||
|
||||
/** 组套id */
|
||||
private Long packageId;
|
||||
|
||||
/** 器材请求状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 请求意图 */
|
||||
private String intentCode;
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先级 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 是否停止执行 */
|
||||
private Integer performFlag;
|
||||
|
||||
/** 分组编号 */
|
||||
private String groupNo;
|
||||
|
||||
/** 器材类型 */
|
||||
private String deviceTypeCode;
|
||||
|
||||
/** 请求数量 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 耗材定义id */
|
||||
private Long deviceDefId;
|
||||
|
||||
/** 器材规格 */
|
||||
private String deviceSpecifications;
|
||||
|
||||
/** 请求发起人 */
|
||||
private Long requesterId;
|
||||
|
||||
/** 请求发起的科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 默认器材房 */
|
||||
private Long locationId;
|
||||
|
||||
/** 发放耗材房 */
|
||||
private Long performLocation;
|
||||
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 用药频次 */
|
||||
private String rateCode;
|
||||
|
||||
/** 预计使用时间 */
|
||||
private Date useTime;
|
||||
|
||||
/** 预计使用开始时间 */
|
||||
private Date useStartTime;
|
||||
|
||||
/** 预计使用结束时间 */
|
||||
private Date useEndTime;
|
||||
|
||||
/** 预计使用周期时间 */
|
||||
private String useTiming;
|
||||
|
||||
/** 请求开始时间 */
|
||||
private Date reqAuthoredTime;
|
||||
|
||||
/** 执行人类型 */
|
||||
private Integer performerEnum;
|
||||
|
||||
/** 执行人 */
|
||||
private Long performerId;
|
||||
|
||||
/** 执行科室 */
|
||||
private Long performOrgId;
|
||||
|
||||
/** 相关诊断 */
|
||||
private String conditionIdJson;
|
||||
|
||||
/** 相关观测 */
|
||||
private String observationIdJson;
|
||||
|
||||
/** 是否可以按需给出 */
|
||||
private Integer asNeedFlag;
|
||||
|
||||
/** 按需使用原因 */
|
||||
private String asNeedReason;
|
||||
|
||||
/** 合同Id */
|
||||
private String contractCode;
|
||||
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
/** 退药id */
|
||||
private Long refundDeviceId;
|
||||
|
||||
/**
|
||||
* 请求内容json
|
||||
*/
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 诊断id
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
/**
|
||||
* 生成来源
|
||||
*/
|
||||
private Integer generateSourceEnum;
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
package com.openhis.workflow.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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-05-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("elep_medication_request")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ElepMedicationRequest extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 医院内部处方编号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 医保处方编号 */
|
||||
private String hiRxno;
|
||||
|
||||
/** 电子处方追溯码 */
|
||||
private String rxTraceCode;
|
||||
|
||||
/** 医院id */
|
||||
private Long organizationId;
|
||||
|
||||
/** 门诊/住院病历号 */
|
||||
private String iptOtpNo;
|
||||
|
||||
/** 科室病区 */
|
||||
private String departmentWard;
|
||||
|
||||
/** 医保类型 */
|
||||
private Integer insuranceEnum;
|
||||
|
||||
/** 开具日期 */
|
||||
private Date issueTime;
|
||||
|
||||
/** 审核日期 */
|
||||
private Date reviewTime;
|
||||
|
||||
/** 撤销日期 */
|
||||
private Date quashTime;
|
||||
|
||||
/** 开具科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 患者 */
|
||||
private Long patientId;
|
||||
|
||||
/** 就诊id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 诊断id */
|
||||
private Long conditionId;
|
||||
|
||||
/** 诊断id */
|
||||
private Long conditionDefId;
|
||||
|
||||
/** 慢病字段 */
|
||||
private String opspDiseCode;
|
||||
|
||||
/** 有效天数 */
|
||||
private Integer validityDays;
|
||||
|
||||
/** 药品定义id */
|
||||
private String medicationId;
|
||||
|
||||
/** 药品剂量 */
|
||||
private BigDecimal medDosage;
|
||||
/** 药品剂量单位 */
|
||||
private String medDosageUnitCode;
|
||||
|
||||
/** 药品频率 */
|
||||
private String medFrequency;
|
||||
|
||||
/** 药品途径 */
|
||||
private String medRoute;
|
||||
|
||||
/** 开方医师 */
|
||||
private Long prescribingDrId;
|
||||
|
||||
/** 审核药师 */
|
||||
private Long reviewDrId;
|
||||
|
||||
/** 撤销药师 */
|
||||
private Long quashDrId;
|
||||
|
||||
/** 调配药师 */
|
||||
private Long dispensingDrId;
|
||||
|
||||
/** 发药药师 */
|
||||
private Long issuingDrId;
|
||||
|
||||
/** 延长原因 */
|
||||
private String extensionReason;
|
||||
|
||||
/** 处方状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 撤销原因 */
|
||||
private String quashReason;
|
||||
|
||||
/** 处方类别 */
|
||||
private Integer rxTypeCode;
|
||||
/** 处方项目类别 */
|
||||
private Integer rxItemTypeCode;
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
/** 服药时间(开始) */
|
||||
private Date effectiveDoseStart;
|
||||
|
||||
/** 服药时间(结束) */
|
||||
private Date effectiveDoseEnd;
|
||||
/** 给药间隔 */
|
||||
private String dispenseInterval;
|
||||
|
||||
/** 单次发药数 */
|
||||
private Integer dispensePerQuantity;
|
||||
|
||||
/** 每次发药供应天数 */
|
||||
private Integer dispensePerDuration;
|
||||
|
||||
/** 药品版本号 */
|
||||
private String version;
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.openhis.workflow.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.openhis.common.enums.PublicationStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 库存项目管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_inventory_item")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class InventoryItem extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 物品类别 */
|
||||
private String categoryCode;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long itemId;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 库存状态 */
|
||||
private Integer inventoryStatusEnum;
|
||||
|
||||
/** 供应商id */
|
||||
private Long supplierId;
|
||||
|
||||
/** 说明书 */
|
||||
private String descriptionText;
|
||||
|
||||
/** 最小单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 当前库存数量(最小单位) */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 特征 */
|
||||
private String characteristicJson;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 生产日期 */
|
||||
private Date productionDate;
|
||||
|
||||
/** 失效日期 */
|
||||
private Date expirationDate;
|
||||
|
||||
/** 有效期(月) */
|
||||
private Integer validityMon;
|
||||
|
||||
/** 库位 */
|
||||
private Long locationStoreId;
|
||||
|
||||
/** 仓库 */
|
||||
private Long locationId;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 追溯码包装层级 */
|
||||
private Integer packagingLevels;
|
||||
|
||||
public InventoryItem() {
|
||||
// 库存状态:启用
|
||||
this.inventoryStatusEnum = PublicationStatus.ACTIVE.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.openhis.workflow.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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 服务申请详情管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_service_request_detail")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ServiceRequestDetail extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 申请主表id */
|
||||
private Long serviceReqId;
|
||||
|
||||
/** 类型编码 */
|
||||
private String typeCode;
|
||||
|
||||
/** 订单相关表 */
|
||||
private String orderDetailTable;
|
||||
|
||||
/** 订单相关id */
|
||||
private Long orderDetailId;
|
||||
|
||||
/** 订单详情 */
|
||||
private String detailJson;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package com.openhis.workflow.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.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 供应发放管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_supply_delivery")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SupplyDelivery extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 申请id */
|
||||
private Long requestId;
|
||||
|
||||
/** 汇总编号 */
|
||||
private Long summaryId;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 发放项目所属表 */
|
||||
private String itemTable;
|
||||
|
||||
/** 发放项目id */
|
||||
private Long itemId;
|
||||
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private String basedOnIds;
|
||||
|
||||
/** 计量单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 状态说明 */
|
||||
private String condition;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 供应人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 发放时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date occurrenceStartTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date occurrenceEndTime;
|
||||
|
||||
/** 发放周期时间 */
|
||||
private String occurrenceTiming;
|
||||
|
||||
/** 接收人 */
|
||||
private Long receiverId;
|
||||
|
||||
/** 接收时间 */
|
||||
private Date receiveTime;
|
||||
|
||||
public SupplyDelivery() {
|
||||
// 默认发放状态:进行中
|
||||
this.statusEnum = DispenseStatus.DRAFT.getValue();
|
||||
// 默认发放类型:
|
||||
this.typeEnum = SupplyType.PRODUCT_TRANSFER.getValue();
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
package com.openhis.workflow.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.openhis.common.enums.ActPriority;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 供应申请管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_supply_request")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SupplyRequest extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 原始单据号 */
|
||||
private String originalBusNo;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先权 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 汇总编号 */
|
||||
private Long summaryId;
|
||||
|
||||
/** 交付 */
|
||||
private Long deliverId;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
/** 合计数量 */
|
||||
private BigDecimal totalQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long itemId;
|
||||
|
||||
/** 物品计量单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 请求细节 */
|
||||
private String detailJson;
|
||||
|
||||
/** 期望时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 供应人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 理由 */
|
||||
private String reason;
|
||||
|
||||
/** 理由类型 */
|
||||
private String reasonCode;
|
||||
|
||||
/** 源仓库类型 */
|
||||
private Integer sourceTypeEnum;
|
||||
|
||||
/** 源仓库 */
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 源仓位 */
|
||||
private Long sourceLocationStoreId;
|
||||
|
||||
/** 目的类型 */
|
||||
private Integer purposeTypeEnum;
|
||||
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 目的仓位 */
|
||||
private Long purposeLocationStoreId;
|
||||
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
|
||||
/** 申请人 */
|
||||
private Long applicantId;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 追溯码单位 */
|
||||
private String traceNoUnitCode;
|
||||
|
||||
/** 包装情况 */
|
||||
private Integer packagingConditionEnum;
|
||||
|
||||
/** 验收结果 */
|
||||
private Integer acceptanceResultEnum;
|
||||
|
||||
/** 发票号 */
|
||||
private String invoiceNo;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 零售价 */
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 零售总价 */
|
||||
private BigDecimal totalRetailPrice;
|
||||
|
||||
/** 批次库存 */
|
||||
private BigDecimal batchInventory;
|
||||
|
||||
/** 规格库存 */
|
||||
private BigDecimal specificationInventory;
|
||||
/** 备注 */
|
||||
private String remake;
|
||||
|
||||
public SupplyRequest() {
|
||||
// 默认单据状态:待审核
|
||||
this.statusEnum = SupplyStatus.PENDING_APPROVAL.getValue();
|
||||
// 默认单据分类:库存供应
|
||||
this.categoryEnum = SupplyCategory.STOCK_SUPPLY.getValue();
|
||||
// 默认优先级:常规
|
||||
this.priorityEnum = ActPriority.ROUTINE.getValue();
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
package com.openhis.workflow.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.openhis.common.enums.ActPriority;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 供应申请管理Entity实体(保存定时盘点信息)
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("wor_aut_supply_request")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SupplyRequestAuto extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 原始单据号 */
|
||||
private String originalBusNo;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先权 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 汇总编号 */
|
||||
private Long summaryId;
|
||||
|
||||
/** 交付 */
|
||||
private Long deliverId;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
/** 合计数量 */
|
||||
private BigDecimal totalQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long itemId;
|
||||
|
||||
/** 物品计量单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 请求细节 */
|
||||
private String detailJson;
|
||||
|
||||
/** 期望时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 供应人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 理由 */
|
||||
private String reason;
|
||||
|
||||
/** 理由类型 */
|
||||
private String reasonCode;
|
||||
|
||||
/** 源仓库类型 */
|
||||
private Integer sourceTypeEnum;
|
||||
|
||||
/** 源仓库 */
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 源仓位 */
|
||||
private Long sourceLocationStoreId;
|
||||
|
||||
/** 目的类型 */
|
||||
private Integer purposeTypeEnum;
|
||||
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 目的仓位 */
|
||||
private Long purposeLocationStoreId;
|
||||
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
|
||||
/** 申请人 */
|
||||
private Long applicantId;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 追溯码单位 */
|
||||
private String traceNoUnitCode;
|
||||
|
||||
/** 包装情况 */
|
||||
private Integer packagingConditionEnum;
|
||||
|
||||
/** 验收结果 */
|
||||
private Integer acceptanceResultEnum;
|
||||
|
||||
/** 发票号 */
|
||||
private String invoiceNo;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 零售价 */
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 零售总价 */
|
||||
private BigDecimal totalRetailPrice;
|
||||
|
||||
/** 批次库存 */
|
||||
private BigDecimal batchInventory;
|
||||
|
||||
/** 规格库存 */
|
||||
private BigDecimal specificationInventory;
|
||||
/** 备注 */
|
||||
private String remake;
|
||||
|
||||
public SupplyRequestAuto() {
|
||||
// 默认单据状态:待审核
|
||||
this.statusEnum = SupplyStatus.PENDING_APPROVAL.getValue();
|
||||
// 默认单据分类:库存供应
|
||||
this.categoryEnum = SupplyCategory.STOCK_SUPPLY.getValue();
|
||||
// 默认优先级:常规
|
||||
this.priorityEnum = ActPriority.ROUTINE.getValue();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.openhis.workflow.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/18 11:31
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ActivityDto {
|
||||
|
||||
private Long itemId;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.openhis.workflow.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @ClassName AdjustPriceDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/16 21:37
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdjustPriceDto {
|
||||
/**
|
||||
* 货品ID
|
||||
*/
|
||||
private Long itemId;
|
||||
/**
|
||||
* 剩余库存总数量
|
||||
*/
|
||||
private BigDecimal totalCount;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String itemTable;
|
||||
/**
|
||||
* 入库批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
/**
|
||||
* 仓库ID 如 药房一,药房二的ID
|
||||
*/
|
||||
private Long locationId;
|
||||
|
||||
private String unitCode;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.openhis.workflow.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePriceDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/19 10:02
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ChangePriceDto {
|
||||
|
||||
private Long chargeId;
|
||||
|
||||
private Long itemId;
|
||||
|
||||
private BigDecimal newPrice;
|
||||
|
||||
private String reason;
|
||||
|
||||
private BigDecimal quantity;
|
||||
|
||||
private Long supplyRequestId;
|
||||
|
||||
private BigDecimal retailPrice;
|
||||
private String itemTable;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ActivityDefinitionMapper extends BaseMapper<ActivityDefinition> {
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 诊疗定义id
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(@Param("activityName") String activityName,
|
||||
@Param("status") Integer status);
|
||||
/**
|
||||
* Desc: 根据 项目id数组 加载 诊疗数据集合
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 12:20 2025/10/18
|
||||
* @return java.util.List<com.openhis.workflow.domain.ActivityDefinition>
|
||||
**/
|
||||
List<ActivityDto> searchActivityDefinitionByIds(@Param("itemIds") List<Long> itemIds);
|
||||
/**
|
||||
* Desc: 根据关键字查询 如果关键字为空,查询10条,否则返回查询到的所有
|
||||
* @param keyWord
|
||||
* @Author raymond
|
||||
* @Date 07:53 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityListByKeyWord(@Param("keyWord") String keyWord);
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 器材发放管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface DeviceDispenseMapper extends BaseMapper<DeviceDispense> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 器材请求管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface DeviceRequestMapper extends BaseMapper<DeviceRequest> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-05-07
|
||||
*/
|
||||
@Repository
|
||||
public interface ElepMedicationRequestMapper extends BaseMapper<ElepMedicationRequest> {
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存项目管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface InventoryItemMapper extends BaseMapper<InventoryItem> {
|
||||
/**
|
||||
* Desc: 根据 productIds 查询 库存大于0的 货品
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 21:56 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.dto.AdjustPriceDto>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataList(@Param("itemIds") List<Long> itemIds);
|
||||
/**
|
||||
* Desc: 根据 productIds 查询 库存大于0的 货品并分组查询
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 21:56 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.dto.AdjustPriceDto>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataListByGroup(@Param("itemIds") List<Long> itemIds);
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ServiceRequestDetail;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 服务申请详情管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ServiceRequestDetailMapper extends BaseMapper<ServiceRequestDetail> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 服务申请管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ServiceRequestMapper extends BaseMapper<ServiceRequest> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 供应发放管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyDeliveryMapper extends BaseMapper<SupplyDelivery> {
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.SupplyRequestAuto;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 供应申请管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyRequestAutoMapper extends BaseMapper<SupplyRequestAuto> {
|
||||
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.dto.ChangePriceDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应申请管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyRequestMapper extends BaseMapper<SupplyRequest> {
|
||||
/**
|
||||
* Desc: 根据 调价单号 查询 supply request 和 价格主表
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:12 2025/10/19
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据 批次号查询 分组后的 产品ID
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:36 2025/10/30
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchGroupDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 med
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchMedInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 查询历史数据 药品调价数据
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 07:22 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryMedInfoData(@Param("busNo") String busNo, @Param("createTime")Date createTime);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 device
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 18:03 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchDeviceInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 查询历史数据 耗材调价数据
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 08:57 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryDeviceInfoDataForBusNo(@Param("busNo") String busNo,@Param("createTime") Date createTime);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 activity
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 18:03 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 activity
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:01 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryActivityInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 health
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 18:03 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHealthInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 health
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:00 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryHealthInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IActivityDefinitionService extends IService<ActivityDefinition> {
|
||||
|
||||
/**
|
||||
* 新增诊疗目录
|
||||
*
|
||||
* @param activityDefinition 诊疗目录实体
|
||||
* @return
|
||||
*/
|
||||
boolean addDiagnosisTreatment(ActivityDefinition activityDefinition);
|
||||
|
||||
/**
|
||||
* 新增医保诊疗目录
|
||||
*
|
||||
* @param activityDefinition 诊疗目录实体
|
||||
* @return
|
||||
*/
|
||||
boolean addYbDiagnosisTreatment(ActivityDefinition activityDefinition);
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 皮试检查-诊疗定义id
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(String activityName);
|
||||
|
||||
/**
|
||||
* Desc: 根据 项目id数组 加载 诊疗数据集合
|
||||
*
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 12:20 2025/10/18
|
||||
* @return java.util.List<com.openhis.workflow.domain.ActivityDefinition>
|
||||
*
|
||||
*/
|
||||
List<ActivityDto> searchActivityDefinitionByIds(@Param("itemIds") List<Long> itemIds);
|
||||
|
||||
/**
|
||||
* Desc: 根据关键字查询 如果关键字为空,查询10条,否则返回查询到的所有
|
||||
*
|
||||
* @param keyWord
|
||||
* @Author raymond
|
||||
* @Date 07:53 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
*
|
||||
*/
|
||||
List<AdjustPriceMedListDto> searchActivityListByKeyWord(String keyWord);
|
||||
|
||||
/**
|
||||
* 查询某一类的服务
|
||||
*
|
||||
* @param productIdList id集合
|
||||
* @param activityDefCategory 类型
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<ActivityDefinition> getListByIds(List<Long> productIdList, Integer activityDefCategory);
|
||||
|
||||
/**
|
||||
* 查询某一类的服务
|
||||
*
|
||||
* @param productIdList id集合
|
||||
* @param typeEnum 类型
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<ActivityDefinition> getListByTypeEnum(List<Long> productIdList, Integer typeEnum);
|
||||
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 器材发放管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
|
||||
/**
|
||||
* 处理器材发放信息
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
* @return 发放id
|
||||
*/
|
||||
Long handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 医嘱执行生成耗材发放,状态为待配药
|
||||
*
|
||||
* @param deviceRequest 耗材医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param locationId 发放器材房
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
Long generateDeviceDispense(DeviceRequest deviceRequest, Long procedureId, Long locationId,
|
||||
Date plannedDispenseTime);
|
||||
|
||||
/**
|
||||
* 医嘱执行生成耗材发放,状态为已发放
|
||||
*
|
||||
* @param deviceRequest 耗材医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param locationId 发放器材房
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
Long generateIssuedDeviceDispense(DeviceRequest deviceRequest, Long procedureId, Long locationId,
|
||||
Date plannedDispenseTime);
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
*
|
||||
* @param deviceReqId 器材请求id
|
||||
*/
|
||||
void deleteDeviceDispense(Long deviceReqId);
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
* @param devDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> devDisIdList, Integer refund);
|
||||
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
List<DeviceDispense> getDevDispenseByProcedureId(List<Long> procedureIdList);
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
*
|
||||
* @param deviceDispense 器材发放信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
* @param quantity 发药数量
|
||||
*/
|
||||
DeviceDispense createCompletedDeviceDispense(DeviceDispense deviceDispense, Date now, Practitioner loginUser,
|
||||
String step, BigDecimal quantity);
|
||||
|
||||
/**
|
||||
* 器材发放状态:已发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean completedStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 器材发放状态:撤回
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean cancelledStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 器材发放状态:待发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean inProgressStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新耗材状态:待配药
|
||||
*
|
||||
* @param deviceRequestIdList 请求id列表
|
||||
*/
|
||||
void updatePreparationDispenseStatus(List<Long> deviceRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新耗材状态:暂停
|
||||
*
|
||||
* @param devReqIdList 请求id列表
|
||||
*/
|
||||
void updateOnHoldDispenseStatus(List<Long> devReqIdList);
|
||||
|
||||
/**
|
||||
* 更新药品状态:已汇总
|
||||
*
|
||||
* @param devDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> devDispenseId);
|
||||
|
||||
/**
|
||||
* 更新耗材状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> medDispenseId, String busNo);
|
||||
|
||||
/**
|
||||
* 通过请求id获取耗材发放信息
|
||||
*
|
||||
* @param requestIdList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<DeviceDispense> selectByRequestIdList(List<Long> requestIdList);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 器材请求管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IDeviceRequestService extends IService<DeviceRequest> {
|
||||
|
||||
/**
|
||||
* 器材请求状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean completedStatusEnum(Long id, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 服务申请状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean activeStatusEnum(Long id, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param devRequestIdList 耗材请求id列表
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> devRequestIdList);
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> devReqIdList);
|
||||
|
||||
/**
|
||||
* 更新请求状态:取消
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
void updateCancelledStatusBatch(List<Long> devReqIdList);
|
||||
|
||||
/**
|
||||
* 获取耗材请求信息
|
||||
*
|
||||
* @param deviceId 耗材id
|
||||
* @return 耗材请求信息
|
||||
*/
|
||||
List<DeviceRequest> getDevRequestByDeviceId(Long deviceId);
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-05-07
|
||||
*/
|
||||
public interface IElepMedicationRequestService extends IService<ElepMedicationRequest> {
|
||||
/**
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
*/
|
||||
List<ElepMedicationRequest> selectElepMedicationRequestByPrescriptionNo(String prescriptionNo);
|
||||
/**
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param prescriptionNoList 处方号
|
||||
*/
|
||||
List<ElepMedicationRequest> selectElepMedicationRequestByPrescriptionNoList(List<String> prescriptionNoList);
|
||||
/**
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param idList id
|
||||
*/
|
||||
List<ElepMedicationRequest> selectElepMedicationRequestById(List<Long> idList);
|
||||
|
||||
|
||||
/**
|
||||
* 删除处方信息
|
||||
*
|
||||
* @param prescriptionNoList 处方号
|
||||
*/
|
||||
boolean deleteElepMedicationRequestByPrescriptionNo(List<String> prescriptionNoList);
|
||||
|
||||
/**
|
||||
* 查询符合条件的记录数。
|
||||
*
|
||||
* @param prescriptionNo 处方编号
|
||||
* @param list 处方类型代码集合
|
||||
* @param tenantId 租户 ID
|
||||
* @return 符合条件的记录数
|
||||
*/
|
||||
Long selectWesternOrChineseCount(String prescriptionNo, List<Integer> list, Integer tenantId);
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IInventoryItemService extends IService<InventoryItem> {
|
||||
|
||||
/**
|
||||
* 入库
|
||||
*
|
||||
* @param InventoryItemList 入库项目
|
||||
*/
|
||||
void stockIn(List<InventoryItem> InventoryItemList);
|
||||
|
||||
/**
|
||||
* 更新库房数量
|
||||
*
|
||||
* @param id 主键
|
||||
* @param quantity 最小单位库存数量
|
||||
* @param now 当前时间
|
||||
* @return 更新件数
|
||||
*/
|
||||
Boolean updateInventoryQuantity(Long id, BigDecimal quantity, Date now);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemId 项目编号
|
||||
* @param lotNumber 产品批号
|
||||
* @param locationId 仓库
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<InventoryItem> selectInventoryByItemId(Long itemId, String lotNumber, Long locationId, Integer tenantId);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemIdList 项目编号列表
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<InventoryItem> selectInventoryByItemIdList(List<Long> itemIdList, Integer tenantId);
|
||||
|
||||
/**
|
||||
* Desc: 根据id 数组检索库存 > 0 的药品或耗材
|
||||
*
|
||||
* @param productIds
|
||||
* @Author raymond
|
||||
* @Date 16:45 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.domain.InventoryItem>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataList(List<Long> productIds);
|
||||
|
||||
/**
|
||||
* Desc: 根据id 数组检索库存 > 0 的药品或耗材并分组
|
||||
*
|
||||
* @param productIds
|
||||
* @Author raymond
|
||||
* @Date 16:45 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.domain.InventoryItem>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataListByGroup(List<Long> productIds);
|
||||
|
||||
List<InventoryItem> selectAllInventory();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.ServiceRequestDetail;
|
||||
|
||||
/**
|
||||
* 服务申请详情管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IServiceRequestDetailService extends IService<ServiceRequestDetail> {
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应发放管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
||||
|
||||
/**
|
||||
* 根据单据,发放物品
|
||||
*
|
||||
* @param supplyRequestList 单据信息
|
||||
* @param now 当前时间
|
||||
*/
|
||||
List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now);
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
*
|
||||
* @param supplyReqIdList 供应申请id列表
|
||||
*/
|
||||
boolean supplyDeliveryValidation(List<Long> supplyReqIdList);
|
||||
|
||||
/**
|
||||
* 更新请求状态:同意
|
||||
*
|
||||
* @param supplyDeliveryIdList 供应发放id列表
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> supplyDeliveryIdList);
|
||||
|
||||
/**
|
||||
* 根据id,获取供应发放列表
|
||||
*
|
||||
* @param deliveryIdList id列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
List<SupplyDelivery> selectByIdList(List<Long> deliveryIdList);
|
||||
|
||||
/**
|
||||
* 根据requestId,获取供应发放列表
|
||||
*
|
||||
* @param requestIdList requestId列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
List<SupplyDelivery> selectByRequestIdList(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* 创建待发药的供应发放
|
||||
*
|
||||
* @param medicationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param receiverId
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
void createSummarySupplyDelivery(Long medicationId, String lotNumber, Long patientId, BigDecimal minQuantity,
|
||||
String minUnitCode, Long receiverId, Long supplyRequestId);
|
||||
|
||||
/**
|
||||
* 创建已发放的供应发放(耗材)
|
||||
*
|
||||
* @param deviceId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
void createDeviceSummarySupplyDelivery(Long deviceId, String lotNumber, BigDecimal minQuantity, String minUnitCode,
|
||||
Long supplyRequestId);
|
||||
|
||||
/**
|
||||
* 根据供应申请id,删除供应发放
|
||||
*
|
||||
* @param requestIdList 供应申请id列表
|
||||
*/
|
||||
void deleteSupplyDeliveryByReqId(List<Long> requestIdList);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.SupplyRequestAuto;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface ISupplyRequestAutoService extends IService<SupplyRequestAuto> {
|
||||
|
||||
}
|
||||
@@ -1,302 +0,0 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.dto.ChangePriceDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
|
||||
/**
|
||||
* 通过单据号查询单据信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
List<SupplyRequest> getSupplyByBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 通过单据号批量查询单据信息
|
||||
*
|
||||
* @param busNoList 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
List<SupplyRequest> getSupplyByBusNoBatch(List<String> busNoList);
|
||||
|
||||
/**
|
||||
* 通过原始单据号查询单据信息
|
||||
*
|
||||
* @param originalBusNo 原始单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
List<SupplyRequest> getSupplyByOriginalBusNo(String originalBusNo);
|
||||
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param now 当前时间
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<SupplyRequest> agreeRequest(String busNo, Date now);
|
||||
|
||||
/**
|
||||
* 添加原始单据号
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param originalBusNo 原始单据号
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<SupplyRequest> addOriginalBusNo(String busNo, String originalBusNo);
|
||||
|
||||
/**
|
||||
* 将原始单据号信息的原始单据号删除
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据详情
|
||||
*/
|
||||
boolean updateByBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 将原始单据号信息的状态改为已失效
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据详情
|
||||
*/
|
||||
boolean updateStatusEnumByBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean submitApproval(String busNo);
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean withdrawApproval(String busNo);
|
||||
|
||||
/**
|
||||
* 删除单据
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean removeByBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 驳回申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
boolean rejectRequest(String busNo);
|
||||
|
||||
/**
|
||||
* 获取供应项目所在表
|
||||
*
|
||||
* @param agreedList 供应单据信息
|
||||
* @return 供应项目所在表
|
||||
*/
|
||||
String getItemTable(List<SupplyRequest> agreedList);
|
||||
|
||||
/**
|
||||
* 获取供应的物品
|
||||
*
|
||||
* @param agreedList 供应单据
|
||||
* @return 物品id
|
||||
*/
|
||||
List<Long> getItem(List<SupplyRequest> agreedList);
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
boolean supplyRequestValidation(String busNo);
|
||||
|
||||
/**
|
||||
* 验证是否发生过业务
|
||||
*
|
||||
* @param itemId 项目id
|
||||
* @return 校验结果
|
||||
*/
|
||||
boolean verifyAbleEdit(Long itemId);
|
||||
|
||||
/**
|
||||
* 通过单据号删除单据信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
boolean deleteRequest(String busNo);
|
||||
|
||||
/**
|
||||
* 更新请求状态:同意
|
||||
*
|
||||
* @param supplyRequestIdList 供应申请id列表
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> supplyRequestIdList);
|
||||
|
||||
/**
|
||||
* 根据id,获取供应申请列表
|
||||
*
|
||||
* @param requestIdList id列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
List<SupplyRequest> selectByIdList(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* Desc: 根据 调价单号 查询 supplyrequest 和 价格主表
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:13 2025/10/19
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param medicationId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
Long createSummarySupplyRequest(Long medicationId, Long locationId, String lotNumber, Long patientId,
|
||||
BigDecimal minQuantity, String minUnitCode, Long practitionerId, Date now, String busNo);
|
||||
|
||||
/**
|
||||
* 生成汇总发药单(耗材)
|
||||
*
|
||||
* @param deviceId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
Long createDeviceSummarySupplyRequest(Long deviceId, Long locationId, String lotNumber, BigDecimal minQuantity,
|
||||
String minUnitCode, Long practitionerId, Date now, String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 med
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchMedInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 查询历史数据 药品调价数据
|
||||
*
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 07:22 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryMedInfoData(String busNo, Date createTime);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 device
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchDeviceInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 查询历史数据 耗材调价数据
|
||||
*
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 08:57 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryDeviceInfoDataForBusNo(String busNo, Date createTime);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 activity
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 activity
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:01 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryActivityInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 health
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHealthInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 health
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:00 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryHealthInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNoList 汇总单号
|
||||
* @return 处理结果
|
||||
*/
|
||||
List<Long> cancelSummarySupplyRequest(List<String> summaryNoList);
|
||||
|
||||
/**
|
||||
* Desc: 根据 批次号查询 分组后的 产品ID
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:36 2025/10/30
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchGroupDataForBusNo(String busNo);
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import lombok.AllArgsConstructor;
|
||||
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业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ActivityDefinitionServiceImpl extends ServiceImpl<ActivityDefinitionMapper, ActivityDefinition>
|
||||
implements IActivityDefinitionService {
|
||||
|
||||
private final ActivityDefinitionMapper activityDefinitionMapper;
|
||||
|
||||
/**
|
||||
* 增加外来诊疗项目
|
||||
*
|
||||
* @param activityDefinition 诊疗项目实体
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addDiagnosisTreatment(ActivityDefinition activityDefinition) {
|
||||
// 根据诊疗编码判断诊疗项目是否存在
|
||||
List<ActivityDefinition> activityDefinitions
|
||||
= activityDefinitionMapper.selectList(new LambdaQueryWrapper<ActivityDefinition>()
|
||||
.eq(ActivityDefinition::getBusNo, activityDefinition.getBusNo()));
|
||||
if (activityDefinitions.size() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 统一补全必填字段(create_by、tenant_id、create_time)
|
||||
setRequiredFields(activityDefinition);
|
||||
|
||||
// 新增诊疗项目
|
||||
int insert = activityDefinitionMapper.insert(activityDefinition);
|
||||
if (insert != 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addYbDiagnosisTreatment(ActivityDefinition activityDefinition) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 诊疗定义id
|
||||
*/
|
||||
@Override
|
||||
public Long getAppointActivityDefinitionId(String activityName) {
|
||||
return baseMapper.getAppointActivityDefinitionId(activityName, PublicationStatus.ACTIVE.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityDto> searchActivityDefinitionByIds(List<Long> itemIds) {
|
||||
return this.activityDefinitionMapper.searchActivityDefinitionByIds(itemIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchActivityListByKeyWord(String keyWord) {
|
||||
return this.activityDefinitionMapper.searchActivityListByKeyWord(keyWord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityDefinition> getListByIds(List<Long> productIdList, Integer activityDefCategory) {
|
||||
LambdaQueryWrapper<ActivityDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (activityDefCategory != null) {
|
||||
queryWrapper.eq(ActivityDefinition::getCategoryCode, activityDefCategory);
|
||||
}
|
||||
queryWrapper.in(ActivityDefinition::getId, productIdList).eq(ActivityDefinition::getDeleteFlag,
|
||||
DelFlag.NO.getCode());
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityDefinition> getListByTypeEnum(List<Long> productIdList, Integer typeEnum) {
|
||||
LambdaQueryWrapper<ActivityDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (typeEnum != null) {
|
||||
queryWrapper.eq(ActivityDefinition::getTypeEnum, typeEnum);
|
||||
}
|
||||
queryWrapper.in(ActivityDefinition::getId, productIdList).eq(ActivityDefinition::getDeleteFlag,
|
||||
DelFlag.NO.getCode());
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置诊疗定义对象的必需字段(tenant_id、create_by、create_time),确保插入时不为null
|
||||
*
|
||||
* @param activityDefinition 诊疗定义对象
|
||||
*/
|
||||
private void setRequiredFields(ActivityDefinition activityDefinition) {
|
||||
String createBy = "system";
|
||||
Integer tenantId = null;
|
||||
try {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
createBy = loginUser.getUsername();
|
||||
tenantId = loginUser.getTenantId();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 如果获取失败,使用默认值
|
||||
}
|
||||
// 强制设置,确保不为null
|
||||
activityDefinition.setCreateBy(createBy != null ? createBy : "system");
|
||||
activityDefinition.setTenantId(tenantId != null ? tenantId : 1); // 默认租户ID为1
|
||||
// 确保创建时间不为null
|
||||
if (activityDefinition.getCreateTime() == null) {
|
||||
activityDefinition.setCreateTime(new Date());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,432 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.mapper.DeviceDispenseMapper;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.core.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 器材发放管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper, DeviceDispense>
|
||||
implements IDeviceDispenseService {
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 处理器材发放信息
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public Long handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType) {
|
||||
DeviceDispense deviceDispense = new DeviceDispense();
|
||||
// 器材发放id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 器材请求id
|
||||
deviceDispense.setDeviceReqId(deviceRequest.getId());
|
||||
// 器材发放状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.DRAFT.getValue());
|
||||
// 发药类型
|
||||
deviceDispense.setDispenseCategoryEnum(deviceRequest.getCategoryEnum());
|
||||
// 器材编码
|
||||
deviceDispense.setDeviceDefId(deviceRequest.getDeviceDefId());
|
||||
// 领药患者
|
||||
deviceDispense.setPatientId(deviceRequest.getPatientId());
|
||||
// 相关诊疗
|
||||
deviceDispense.setEncounterId(deviceRequest.getEncounterId());
|
||||
// 发放数量
|
||||
deviceDispense.setQuantity(deviceRequest.getQuantity());
|
||||
// 发放单位
|
||||
deviceDispense.setUnitCode(deviceRequest.getUnitCode());
|
||||
// 产品批号
|
||||
deviceDispense.setLotNumber(deviceRequest.getLotNumber());
|
||||
// 发药人
|
||||
deviceDispense.setPerformerId(deviceRequest.getPerformerId());
|
||||
// 发放器材房
|
||||
deviceDispense.setLocationId(deviceRequest.getPerformLocation());
|
||||
// 支持用药信息
|
||||
deviceDispense.setSupportInfo(deviceRequest.getSupportInfo());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(BigDecimal.ZERO);
|
||||
// 发药频次
|
||||
deviceDispense.setDispenseFrequencyCode(deviceRequest.getRateCode());
|
||||
// 设置租户id
|
||||
LoginUser loginUser = getLoginUser();
|
||||
deviceDispense.setTenantId(loginUser.getTenantId());
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加2小时
|
||||
LocalDateTime newTime = now.plusHours(2);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
deviceDispense.setLimitTime(limitTime);
|
||||
|
||||
// 显式设置tenantId、createBy和createTime字段,防止自动填充机制失效
|
||||
deviceDispense.setTenantId(getLoginUser().getTenantId());
|
||||
deviceDispense.setCreateBy(getLoginUser().getUsername());
|
||||
deviceDispense.setCreateTime(new Date());
|
||||
|
||||
baseMapper.insert(deviceDispense);
|
||||
|
||||
// if (DbOpType.INSERT.getCode().equals(dbOpType)) {
|
||||
// baseMapper.insert(deviceDispense);
|
||||
// } else if (DbOpType.UPDATE.getCode().equals(dbOpType)) {
|
||||
// baseMapper.update(deviceDispense,
|
||||
// new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getDeviceReqId, deviceRequest.getId()));
|
||||
// }
|
||||
return deviceDispense.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行生成耗材发放,状态为待配药
|
||||
*
|
||||
* @param deviceRequest 耗材医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param locationId 发放器材房
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public Long generateDeviceDispense(DeviceRequest deviceRequest, Long procedureId, Long locationId,
|
||||
Date plannedDispenseTime) {
|
||||
DeviceDispense deviceDispense = new DeviceDispense();
|
||||
// 执行id
|
||||
deviceDispense.setProcedureId(procedureId);
|
||||
// 预定发药时间
|
||||
deviceDispense.setPlannedDispenseTime(plannedDispenseTime);
|
||||
// 器材发放id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 器材请求id
|
||||
deviceDispense.setDeviceReqId(deviceRequest.getId());
|
||||
// 器材发放状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.PREPARATION.getValue());
|
||||
// 发药类型
|
||||
deviceDispense.setDispenseCategoryEnum(deviceRequest.getCategoryEnum());
|
||||
// 器材编码
|
||||
deviceDispense.setDeviceDefId(deviceRequest.getDeviceDefId());
|
||||
// 领药患者
|
||||
deviceDispense.setPatientId(deviceRequest.getPatientId());
|
||||
// 相关诊疗
|
||||
deviceDispense.setEncounterId(deviceRequest.getEncounterId());
|
||||
// 发放数量
|
||||
deviceDispense.setQuantity(deviceRequest.getQuantity());
|
||||
// 发放单位
|
||||
deviceDispense.setUnitCode(deviceRequest.getUnitCode());
|
||||
// 产品批号
|
||||
deviceDispense.setLotNumber(deviceRequest.getLotNumber());
|
||||
// 发药人
|
||||
deviceDispense.setPerformerId(deviceRequest.getPerformerId());
|
||||
// 发放器材房
|
||||
deviceDispense.setLocationId(locationId);
|
||||
// 支持用药信息
|
||||
deviceDispense.setSupportInfo(deviceRequest.getSupportInfo());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(BigDecimal.ZERO);
|
||||
// 发药频次
|
||||
deviceDispense.setDispenseFrequencyCode(deviceRequest.getRateCode());
|
||||
// 设置租户id
|
||||
LoginUser loginUser = getLoginUser();
|
||||
deviceDispense.setTenantId(loginUser.getTenantId());
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加12小时
|
||||
LocalDateTime newTime = now.plusHours(12);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
deviceDispense.setLimitTime(limitTime);
|
||||
baseMapper.insert(deviceDispense);
|
||||
|
||||
return deviceDispense.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
*
|
||||
* @param deviceReqId 器材请求id
|
||||
*/
|
||||
@Override
|
||||
public void deleteDeviceDispense(Long deviceReqId) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<DeviceDispense>().eq(DeviceDispense::getDeviceReqId, deviceReqId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
* @param devDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
@Override
|
||||
public void updateStopDispenseStatus(List<Long> devDisIdList, Integer refund) {
|
||||
baseMapper.update(
|
||||
new DeviceDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund),
|
||||
new LambdaUpdateWrapper<DeviceDispense>().in(DeviceDispense::getId, devDisIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param procedureIdList 执行id列表
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> getDevDispenseByProcedureId(List<Long> procedureIdList) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getProcedureId, procedureIdList)
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
*
|
||||
* @param deviceDispense 器材发放信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
* @param quantity 发药数量
|
||||
*/
|
||||
@Override
|
||||
public DeviceDispense createCompletedDeviceDispense(DeviceDispense deviceDispense, Date now, Practitioner loginUser,
|
||||
String step, BigDecimal quantity) {
|
||||
// 服务请求编码
|
||||
deviceDispense.setBusNo(deviceDispense.getBusNo() + "." + step);
|
||||
// // 请求基于什么
|
||||
// deviceDispense.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE);
|
||||
// // 请求基于什么的ID
|
||||
// deviceDispense.setBasedOnId(deviceDispense.getId());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(quantity);
|
||||
// 状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.COMPLETED.getValue());
|
||||
// 发药人
|
||||
deviceDispense.setPerformerId(loginUser.getId());
|
||||
// 发放科室
|
||||
deviceDispense.setLocationId(loginUser.getOrgId());
|
||||
// 发药时间
|
||||
deviceDispense.setDispenseTime(now);
|
||||
// id
|
||||
deviceDispense.setId(null);
|
||||
// 设置租户id
|
||||
LoginUser currentLoginUser = getLoginUser();
|
||||
deviceDispense.setTenantId(currentLoginUser.getTenantId());
|
||||
// 新增器材发放
|
||||
baseMapper.insert(deviceDispense);
|
||||
|
||||
return deviceDispense;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材发放状态:已发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean completedStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getId, id)
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue())
|
||||
.set(DeviceDispense::getPerformerId, loginUser.getId())
|
||||
.set(DeviceDispense::getLocationId, loginUser.getOrgId()).set(DeviceDispense::getDispenseTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材发放状态:撤回
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean cancelledStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getId, id)
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.CANCELLED.getValue())
|
||||
.set(DeviceDispense::getPerformerId, loginUser.getId())
|
||||
.set(DeviceDispense::getLocationId, loginUser.getOrgId()).set(DeviceDispense::getDispenseTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材发放状态:待发药
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean inProgressStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getId, id)
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.IN_PROGRESS.getValue())
|
||||
.set(DeviceDispense::getPerformerId, loginUser.getId())
|
||||
.set(DeviceDispense::getLocationId, loginUser.getOrgId()).set(DeviceDispense::getDispenseTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新耗材状态:待配药
|
||||
*
|
||||
* @param deviceRequestIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updatePreparationDispenseStatus(List<Long> deviceRequestIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.in(DeviceDispense::getDeviceReqId, deviceRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新耗材状态:暂停
|
||||
*
|
||||
* @param devReqIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateOnHoldDispenseStatus(List<Long> devReqIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.ON_HOLD.getValue())
|
||||
.in(DeviceDispense::getDeviceDefId, devReqIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:已汇总
|
||||
*
|
||||
* @param devDispenseId 发放id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDispenseStatusSummarized(List<Long> devDispenseId) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
.in(DeviceDispense::getId, devDispenseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新耗材状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDispenseStatusSummarized(List<Long> medDispenseId, String busNo) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
// TODO 数据库需要加字段
|
||||
// .set(DeviceDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
// .set(DeviceDispense::getSummaryNo, busNo)
|
||||
.in(DeviceDispense::getId, medDispenseId).eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过请求id获取耗材发放信息
|
||||
*
|
||||
* @param requestIdList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> selectByRequestIdList(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<DeviceDispense>()
|
||||
.in(DeviceDispense::getDeviceReqId, requestIdList).eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行生成耗材发放,状态为已完成
|
||||
*
|
||||
* @param deviceRequest 耗材医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param locationId 发放器材房
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public Long generateIssuedDeviceDispense(DeviceRequest deviceRequest, Long procedureId, Long locationId,
|
||||
Date plannedDispenseTime) {
|
||||
DeviceDispense deviceDispense = new DeviceDispense();
|
||||
// 执行id
|
||||
deviceDispense.setProcedureId(procedureId);
|
||||
// 预定发药时间
|
||||
deviceDispense.setPlannedDispenseTime(plannedDispenseTime);
|
||||
// 设置发放时间
|
||||
deviceDispense.setDispenseTime(plannedDispenseTime);
|
||||
// 器材发放id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 器材请求id
|
||||
deviceDispense.setDeviceReqId(deviceRequest.getId());
|
||||
// 器材发放状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.COMPLETED.getValue());
|
||||
// 发药类型
|
||||
deviceDispense.setDispenseCategoryEnum(deviceRequest.getCategoryEnum());
|
||||
// 器材编码
|
||||
deviceDispense.setDeviceDefId(deviceRequest.getDeviceDefId());
|
||||
// 领药患者
|
||||
deviceDispense.setPatientId(deviceRequest.getPatientId());
|
||||
// 相关诊疗
|
||||
deviceDispense.setEncounterId(deviceRequest.getEncounterId());
|
||||
// 发放数量
|
||||
deviceDispense.setQuantity(deviceRequest.getQuantity());
|
||||
// 发放单位
|
||||
deviceDispense.setUnitCode(deviceRequest.getUnitCode());
|
||||
// 产品批号
|
||||
deviceDispense.setLotNumber(deviceRequest.getLotNumber());
|
||||
// 发药人
|
||||
// todo 存疑,是否用请求人作为发药人
|
||||
LoginUser loginUser = getLoginUser();
|
||||
deviceDispense.setPerformerId(loginUser.getPractitionerId());
|
||||
// 设置租户id
|
||||
deviceDispense.setTenantId(loginUser.getTenantId());
|
||||
// 发放器材房
|
||||
deviceDispense.setLocationId(locationId);
|
||||
// 支持用药信息
|
||||
deviceDispense.setSupportInfo(deviceRequest.getSupportInfo());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(deviceRequest.getQuantity());
|
||||
// 发药频次
|
||||
deviceDispense.setDispenseFrequencyCode(deviceRequest.getRateCode());
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加12小时
|
||||
LocalDateTime newTime = now.plusHours(12);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
deviceDispense.setLimitTime(limitTime);
|
||||
baseMapper.insert(deviceDispense);
|
||||
|
||||
return deviceDispense.getId();
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.mapper.DeviceRequestMapper;
|
||||
import com.openhis.workflow.service.IDeviceRequestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 器材请求管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class DeviceRequestServiceImpl extends ServiceImpl<DeviceRequestMapper, DeviceRequest>
|
||||
implements IDeviceRequestService {
|
||||
|
||||
/**
|
||||
* 器材请求状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean completedStatusEnum(Long id, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceRequest>().eq(DeviceRequest::getId, id)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue())
|
||||
.set(DeviceRequest::getPerformerId, loginUser.getId())
|
||||
.set(DeviceRequest::getLocationId, loginUser.getOrgId()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 器材请求状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean activeStatusEnum(Long id, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceRequest>().eq(DeviceRequest::getId, id)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||
.set(DeviceRequest::getPerformerId, loginUser.getId())
|
||||
.set(DeviceRequest::getLocationId, loginUser.getOrgId()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param devRequestIdList 耗材请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> devRequestIdList) {
|
||||
baseMapper.update(new DeviceRequest().setStatusEnum(RequestStatus.COMPLETED.getValue()),
|
||||
new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:待发送
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> devReqIdList) {
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.DRAFT.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:取消
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCancelledStatusBatch(List<Long> devReqIdList) {
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.CANCELLED.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取耗材请求信息
|
||||
*
|
||||
* @param deviceId 耗材id
|
||||
* @return 耗材请求信息
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceRequest> getDevRequestByDeviceId(Long deviceId) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<DeviceRequest>().eq(DeviceRequest::getDeviceDefId, deviceId)
|
||||
.eq(DeviceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
import com.openhis.workflow.mapper.ElepMedicationRequestMapper;
|
||||
import com.openhis.workflow.service.IElepMedicationRequestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-05-07
|
||||
*/
|
||||
@Service
|
||||
public class ElepMedicationRequestServiceImpl extends ServiceImpl<ElepMedicationRequestMapper, ElepMedicationRequest>
|
||||
implements IElepMedicationRequestService {
|
||||
|
||||
/**
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
*/
|
||||
@Override
|
||||
public List<ElepMedicationRequest> selectElepMedicationRequestByPrescriptionNo(String prescriptionNo) {
|
||||
return (baseMapper.selectList(new LambdaQueryWrapper<ElepMedicationRequest>()
|
||||
.eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param prescriptionNoList 处方号
|
||||
*/
|
||||
@Override
|
||||
public List<ElepMedicationRequest>
|
||||
selectElepMedicationRequestByPrescriptionNoList(List<String> prescriptionNoList) {
|
||||
return (baseMapper.selectList(new LambdaQueryWrapper<ElepMedicationRequest>()
|
||||
.in(ElepMedicationRequest::getPrescriptionNo, prescriptionNoList)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param idList id
|
||||
*/
|
||||
@Override
|
||||
public List<ElepMedicationRequest> selectElepMedicationRequestById(List<Long> idList) {
|
||||
return (baseMapper
|
||||
.selectList(new LambdaQueryWrapper<ElepMedicationRequest>().in(ElepMedicationRequest::getId, idList)));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方信息
|
||||
*
|
||||
* @param prescriptionNoList 处方号
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteElepMedicationRequestByPrescriptionNo(List<String> prescriptionNoList) {
|
||||
int count = baseMapper.delete(new LambdaQueryWrapper<ElepMedicationRequest>()
|
||||
.in(ElepMedicationRequest::getPrescriptionNo, prescriptionNoList));
|
||||
if (count > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的 MedicationRequest 记录数。
|
||||
*
|
||||
* @param prescriptionNo 处方编号
|
||||
* @param list 处方类型代码集合
|
||||
* @param tenantId 租户 ID
|
||||
* @return 符合条件的记录数
|
||||
*/
|
||||
@Override
|
||||
public Long selectWesternOrChineseCount(String prescriptionNo, List<Integer> list, Integer tenantId) {
|
||||
// 创建查询条件
|
||||
LambdaQueryWrapper<ElepMedicationRequest> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo)
|
||||
.in(ElepMedicationRequest::getRxItemTypeCode, list).eq(ElepMedicationRequest::getTenantId, tenantId);
|
||||
|
||||
// 调用 Mapper 的 selectCount 方法
|
||||
return this.baseMapper.selectCount(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, InventoryItem>
|
||||
implements IInventoryItemService {
|
||||
|
||||
/**
|
||||
* 入库
|
||||
*
|
||||
* @param inventoryItemList 入库项目
|
||||
*/
|
||||
@Override
|
||||
public void stockIn(List<InventoryItem> inventoryItemList) {
|
||||
for (InventoryItem inventoryItem : inventoryItemList) {
|
||||
baseMapper.insert(inventoryItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新库房数量
|
||||
*
|
||||
* @param id 主键
|
||||
* @param quantity 最小单位库存数量
|
||||
* @param now 当前时间
|
||||
* @return 更新件数
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateInventoryQuantity(Long id, BigDecimal quantity, Date now) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<InventoryItem>().eq(InventoryItem::getId, id)
|
||||
.set(InventoryItem::getUpdateTime, now).set(InventoryItem::getQuantity, quantity));
|
||||
return updateCount > 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemId 项目编号
|
||||
* @param lotNumber 产品批号
|
||||
* @param locationId 仓库
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<InventoryItem> selectInventoryByItemId(Long itemId, String lotNumber, Long locationId,
|
||||
Integer tenantId) {
|
||||
LambdaQueryWrapper<InventoryItem> queryWrapper = new LambdaQueryWrapper<InventoryItem>()
|
||||
.eq(InventoryItem::getItemId, itemId).eq(InventoryItem::getLotNumber, lotNumber)
|
||||
.eq(InventoryItem::getTenantId, tenantId).eq(InventoryItem::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(InventoryItem::getInventoryStatusEnum, PublicationStatus.ACTIVE.getValue());
|
||||
if (locationId != null) {
|
||||
queryWrapper.eq(InventoryItem::getLocationId, locationId);
|
||||
}
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemIdList 项目编号列表
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<InventoryItem> selectInventoryByItemIdList(List<Long> itemIdList, Integer tenantId) {
|
||||
LambdaQueryWrapper<InventoryItem> queryWrapper
|
||||
= new LambdaQueryWrapper<InventoryItem>().in(InventoryItem::getItemId, itemIdList)
|
||||
.eq(InventoryItem::getTenantId, tenantId).eq(InventoryItem::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(InventoryItem::getInventoryStatusEnum, PublicationStatus.ACTIVE.getValue());
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<InventoryItem> selectAllInventory() {
|
||||
LambdaQueryWrapper<InventoryItem> queryWrapper
|
||||
= new LambdaQueryWrapper<InventoryItem>().eq(InventoryItem::getDeleteFlag, DelFlag.NO.getCode());
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceDto> searchResultDataList(List<Long> productIds) {
|
||||
|
||||
return baseMapper.searchResultDataList(productIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceDto> searchResultDataListByGroup(List<Long> productIds) {
|
||||
return baseMapper.searchResultDataListByGroup(productIds);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.workflow.domain.ServiceRequestDetail;
|
||||
import com.openhis.workflow.mapper.ServiceRequestDetailMapper;
|
||||
import com.openhis.workflow.service.IServiceRequestDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 服务申请详情管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ServiceRequestDetailServiceImpl extends ServiceImpl<ServiceRequestDetailMapper, ServiceRequestDetail> implements IServiceRequestDetailService {
|
||||
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应发放管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper, SupplyDelivery>
|
||||
implements ISupplyDeliveryService {
|
||||
|
||||
/**
|
||||
* 根据单据,发放物品
|
||||
*
|
||||
* @param supplyRequestList 单据信息
|
||||
* @param now 当前时间
|
||||
* @return 发放详情
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now) {
|
||||
|
||||
List<SupplyDelivery> deliveryList = new ArrayList<>();
|
||||
// 根据申请单据生成发放单据
|
||||
for (SupplyRequest supplyRequest : supplyRequestList) {
|
||||
SupplyDelivery supplyDelivery = new SupplyDelivery();
|
||||
supplyDelivery
|
||||
// 请求id
|
||||
.setRequestId(supplyRequest.getId())
|
||||
// 发放状态:已发放
|
||||
.setStatusEnum(DispenseStatus.COMPLETED.getValue())
|
||||
// 单据类型
|
||||
.setTypeEnum(supplyRequest.getTypeEnum())
|
||||
// 发放项目所在表
|
||||
.setItemTable(supplyRequest.getItemTable())
|
||||
// 发放物品id
|
||||
.setItemId(supplyRequest.getItemId())
|
||||
// 物品单位
|
||||
.setUnitCode(supplyRequest.getUnitCode())
|
||||
// 发放数量
|
||||
.setQuantity(supplyRequest.getItemQuantity())
|
||||
// 批次号
|
||||
.setLotNumber(supplyRequest.getLotNumber())
|
||||
// 追溯码
|
||||
.setTraceNo(supplyRequest.getTraceNo())
|
||||
// 供应商id
|
||||
.setSupplierId(supplyRequest.getSupplierId())
|
||||
// 审批人
|
||||
.setPractitionerId(supplyRequest.getApplicantId())
|
||||
// 发放时间
|
||||
.setOccurrenceTime(now)
|
||||
// 接收位置
|
||||
.setReceiverId(supplyRequest.getPurposeLocationId())
|
||||
// 接收时间
|
||||
.setReceiveTime(now)
|
||||
// 生产日期
|
||||
.setOccurrenceStartTime(supplyRequest.getStartTime())
|
||||
// 失效日期
|
||||
.setOccurrenceEndTime(supplyRequest.getEndTime());
|
||||
deliveryList.add(supplyDelivery);
|
||||
// 新增发放单据
|
||||
baseMapper.insert(supplyDelivery);
|
||||
}
|
||||
return deliveryList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
*
|
||||
* @param supplyReqIdList 供应申请id列表
|
||||
*/
|
||||
@Override
|
||||
public boolean supplyDeliveryValidation(List<Long> supplyReqIdList) {
|
||||
|
||||
// 根据请求id查询发放状态
|
||||
List<SupplyDelivery> deliveryList = baseMapper.selectList(new LambdaQueryWrapper<SupplyDelivery>()
|
||||
.eq(SupplyDelivery::getDeleteFlag, DelFlag.NO.getCode()).in(SupplyDelivery::getRequestId, supplyReqIdList));
|
||||
if (!deliveryList.isEmpty()) {
|
||||
List<Integer> deliveryStatusList = deliveryList.stream().map(SupplyDelivery::getStatusEnum).toList();
|
||||
return deliveryStatusList.stream().anyMatch(x -> x.equals(DispenseStatus.COMPLETED.getValue()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:已完成
|
||||
*
|
||||
* @param supplyDeliveryIdList 供应发放id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> supplyDeliveryIdList) {
|
||||
baseMapper.update(
|
||||
new SupplyDelivery().setStatusEnum(DispenseStatus.COMPLETED.getValue())
|
||||
.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||
.setOccurrenceTime(DateUtils.getNowDate()).setReceiveTime(DateUtils.getNowDate()),
|
||||
new LambdaUpdateWrapper<SupplyDelivery>().in(SupplyDelivery::getId, supplyDeliveryIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id,获取供应发放列表
|
||||
*
|
||||
* @param deliveryIdList id列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyDelivery> selectByIdList(List<Long> deliveryIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyDelivery>().in(SupplyDelivery::getId, deliveryIdList)
|
||||
.eq(SupplyDelivery::getDeleteFlag, DelFlag.YES.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据requestId,获取供应发放列表
|
||||
*
|
||||
* @param requestIdList requestId列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyDelivery> selectByRequestIdList(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyDelivery>()
|
||||
.in(SupplyDelivery::getRequestId, requestIdList).eq(SupplyDelivery::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建待发药的供应发放
|
||||
*
|
||||
* @param medicationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param receiverId
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
@Override
|
||||
public void createSummarySupplyDelivery(Long medicationId, String lotNumber, Long patientId, BigDecimal minQuantity,
|
||||
String minUnitCode, Long receiverId, Long supplyRequestId) {
|
||||
baseMapper.insert(new SupplyDelivery().setItemId(medicationId)
|
||||
.setItemTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION).setLotNumber(lotNumber)
|
||||
.setPatientId(patientId).setQuantity(minQuantity).setUnitCode(minUnitCode)
|
||||
.setTypeEnum(SupplyType.SUMMARY_DISPENSE.getValue()).setRequestId(supplyRequestId)
|
||||
.setStatusEnum(DispenseStatus.PREPARATION.getValue()).setReceiverId(receiverId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建已发放的供应发放(耗材)
|
||||
*
|
||||
* @param deviceId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
@Override
|
||||
public void createDeviceSummarySupplyDelivery(Long deviceId, String lotNumber, BigDecimal minQuantity,
|
||||
String minUnitCode, Long supplyRequestId) {
|
||||
baseMapper.insert(new SupplyDelivery().setItemId(deviceId)
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setLotNumber(lotNumber)
|
||||
.setQuantity(minQuantity).setUnitCode(minUnitCode).setTypeEnum(SupplyType.DEVICE_STOCKTAKING.getValue())
|
||||
.setRequestId(supplyRequestId).setStatusEnum(DispenseStatus.COMPLETED.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据供应申请id,删除供应发放
|
||||
*
|
||||
* @param requestIdList 供应申请id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteSupplyDeliveryByReqId(List<Long> requestIdList) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<SupplyDelivery>().in(SupplyDelivery::getRequestId, requestIdList));
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.workflow.domain.SupplyRequestAuto;
|
||||
import com.openhis.workflow.mapper.SupplyRequestAutoMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestAutoService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SupplyRequestAutoServiceImpl extends ServiceImpl<SupplyRequestAutoMapper, SupplyRequestAuto>
|
||||
implements ISupplyRequestAutoService {
|
||||
|
||||
}
|
||||
@@ -1,413 +0,0 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.dto.ChangePriceDto;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, SupplyRequest>
|
||||
implements ISupplyRequestService {
|
||||
|
||||
@Resource
|
||||
private SupplyRequestMapper supplyRequestMapper;
|
||||
|
||||
/**
|
||||
* 通过单据号查询单据信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByBusNo(String busNo) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过单据号批量查询单据信息
|
||||
*
|
||||
* @param busNoList 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByBusNoBatch(List<String> busNoList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getBusNo, busNoList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过原始单据号查询单据信息
|
||||
*
|
||||
* @param originalBusNo 原始单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByOriginalBusNo(String originalBusNo) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getOriginalBusNo, originalBusNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param now 当前时间
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> agreeRequest(String busNo, Date now) {
|
||||
// 更新单据状态
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApprovalTime, now)
|
||||
.set(SupplyRequest::getApproverId, SecurityUtils.getLoginUser().getPractitionerId())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.AGREE.getValue()));
|
||||
// 返回单据详情
|
||||
return this.getSupplyByBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加原始单据号
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param originalBusNo 原始单据号
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> addOriginalBusNo(String busNo, String originalBusNo) {
|
||||
// 更新单据状态
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getOriginalBusNo, originalBusNo));
|
||||
// 返回单据详情
|
||||
return this.getSupplyByBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将原始单据号信息的原始单据号删除
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public boolean updateByBusNo(String busNo) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getOriginalBusNo, ""));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将原始单据号信息的状态改为已失效
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public boolean updateStatusEnumByBusNo(String busNo) {
|
||||
int updateCount
|
||||
= baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.EXPIRED_INVALIDATED.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean submitApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApplyTime, DateUtils.getNowDate())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean withdrawApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApplyTime, DateUtils.getNowDate())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单据
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean removeByBusNo(String busNo) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getDeleteFlag, DelFlag.YES.getCode()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
@Override
|
||||
public boolean rejectRequest(String busNo) {
|
||||
// 更新单据状态
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApprovalTime, DateUtils.getNowDate())
|
||||
.set(SupplyRequest::getApproverId, SecurityUtils.getLoginUser().getPractitionerId())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.REJECT.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应项目所在表
|
||||
*
|
||||
* @param agreedList 供应单据信息
|
||||
* @return 供应项目所在表
|
||||
*/
|
||||
@Override
|
||||
public String getItemTable(List<SupplyRequest> agreedList) {
|
||||
return agreedList.stream().map(SupplyRequest::getItemTable).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应的物品
|
||||
*
|
||||
* @param agreedList 供应单据
|
||||
* @return 物品id
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getItem(List<SupplyRequest> agreedList) {
|
||||
return agreedList.stream().map(SupplyRequest::getItemId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
@Override
|
||||
public boolean supplyRequestValidation(String busNo) {
|
||||
|
||||
// 根据单据号查询请求状态
|
||||
List<SupplyRequest> requestList
|
||||
= baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
if (!requestList.isEmpty()) {
|
||||
for (SupplyRequest supplyRequest : requestList) {
|
||||
if (SupplyStatus.AGREE.getValue().equals(supplyRequest.getStatusEnum())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否发生过业务
|
||||
*
|
||||
* @param itemId 项目id
|
||||
* @return 校验结果
|
||||
*/
|
||||
@Override
|
||||
public boolean verifyAbleEdit(Long itemId) {
|
||||
return baseMapper.exists(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getItemId, itemId)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.in(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue(), SupplyStatus.AGREE.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过单据号删除单据信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteRequest(String busNo) {
|
||||
// 更新单据状态
|
||||
int deleteCount = baseMapper.delete(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
|
||||
return deleteCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:同意
|
||||
*
|
||||
* @param supplyRequestIdList 供应申请id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCompletedStatusBatch(List<Long> supplyRequestIdList) {
|
||||
baseMapper.update(new SupplyRequest().setStatusEnum(SupplyStatus.AGREE.getValue())
|
||||
.setApproverId(SecurityUtils.getLoginUser().getPractitionerId()).setApprovalTime(DateUtils.getNowDate()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().in(SupplyRequest::getId, supplyRequestIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id,获取供应申请列表
|
||||
*
|
||||
* @param requestIdList id列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> selectByIdList(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getId, requestIdList)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChangePriceDto> searchDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param medicationId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
@Override
|
||||
public Long createSummarySupplyRequest(Long medicationId, Long locationId, String lotNumber, Long patientId,
|
||||
BigDecimal minQuantity, String minUnitCode, Long practitionerId, Date now, String busNo) {
|
||||
SupplyRequest supplyRequest = new SupplyRequest().setItemId(medicationId).setSourceLocationId(locationId)
|
||||
.setLotNumber(lotNumber).setPatientId(patientId).setItemQuantity(minQuantity).setUnitCode(minUnitCode)
|
||||
.setApplicantId(practitionerId).setApplyTime(now).setBusNo(busNo)
|
||||
.setStatusEnum(SupplyStatus.SEND.getValue()).setTypeEnum(SupplyType.SUMMARY_DISPENSE.getValue())
|
||||
.setItemTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue());
|
||||
baseMapper.insert(supplyRequest);
|
||||
return supplyRequest.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param deviceId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
@Override
|
||||
public Long createDeviceSummarySupplyRequest(Long deviceId, Long locationId, String lotNumber,
|
||||
BigDecimal minQuantity, String minUnitCode, Long practitionerId, Date now, String busNo) {
|
||||
SupplyRequest supplyRequest = new SupplyRequest().setItemId(deviceId).setSourceLocationId(locationId)
|
||||
.setLotNumber(lotNumber).setItemQuantity(minQuantity).setUnitCode(minUnitCode)
|
||||
.setApplicantId(practitionerId).setApplyTime(now).setBusNo(busNo)
|
||||
.setStatusEnum(SupplyStatus.SEND.getValue()).setTypeEnum(SupplyType.DEVICE_STOCKTAKING.getValue())
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue());
|
||||
baseMapper.insert(supplyRequest);
|
||||
return supplyRequest.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchMedInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchMedInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryMedInfoData(String busNo, Date createTime) {
|
||||
return this.supplyRequestMapper.searchHistoryMedInfoData(busNo, createTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchDeviceInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchDeviceInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryDeviceInfoDataForBusNo(String busNo, Date createTime) {
|
||||
return this.supplyRequestMapper.searchHistoryDeviceInfoDataForBusNo(busNo, createTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchActivityInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchActivityInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryActivityInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchHistoryActivityInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHealthInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchHealthInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryHealthInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchHistoryHealthInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNoList 汇总单号
|
||||
* @return 汇总单ids
|
||||
*/
|
||||
@Override
|
||||
public List<Long> cancelSummarySupplyRequest(List<String> summaryNoList) {
|
||||
// 查询汇总发药单
|
||||
List<SupplyRequest> supplyRequestList
|
||||
= baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getBusNo, summaryNoList)
|
||||
.eq(SupplyRequest::getTypeEnum, SupplyType.SUMMARY_DISPENSE.getValue())
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
// 软删除汇总发药单
|
||||
baseMapper.delete(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getBusNo, summaryNoList)
|
||||
.eq(SupplyRequest::getTypeEnum, SupplyType.SUMMARY_DISPENSE.getValue()));
|
||||
if (supplyRequestList != null && !supplyRequestList.isEmpty()) {
|
||||
return supplyRequestList.stream().map(SupplyRequest::getId).toList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChangePriceDto> searchGroupDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchGroupDataForBusNo(busNo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user