版本更新
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
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_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;
|
||||
|
||||
/** 所属科室 */
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
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.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 Integer 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 Integer dispenseQuantity;
|
||||
|
||||
/** 发药频次 */
|
||||
private String dispenseFrequencyCode;
|
||||
|
||||
/** 配药时间 */
|
||||
private Date prepareTime;
|
||||
|
||||
/** 发药时间 */
|
||||
private Date dispenseTime;
|
||||
|
||||
/** 限制发药时间 */
|
||||
private Date limitTime;
|
||||
|
||||
/** 预定发药时间 */
|
||||
private Date plannedDispenseTime;
|
||||
|
||||
/** 发药目的地 */
|
||||
private String desLocationId;
|
||||
|
||||
/** 接收人 */
|
||||
private String recPractitionerId;
|
||||
|
||||
/** 使用说明 */
|
||||
private String usageInstruction;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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_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 Integer 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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】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;
|
||||
|
||||
/** 有效天数 */
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 库存项目管理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;
|
||||
|
||||
/** 采购单价(包装单位) */
|
||||
private BigDecimal price;
|
||||
|
||||
public InventoryItem() {
|
||||
// 库存状态:启用
|
||||
this.inventoryStatusEnum = PublicationStatus.ACTIVE.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
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")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ServiceRequest extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 服务编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 请求基于什么 */
|
||||
private String basedOnTable;
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
/** 组合id */
|
||||
private Long requisitionId;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 分组编号 */
|
||||
private Long groupId;
|
||||
|
||||
/** 优先权 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 是否执行 */
|
||||
private Integer performFlag;
|
||||
|
||||
/** 诊疗定义id */
|
||||
private Long activityId;
|
||||
|
||||
/** 数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 请求执行的目标患者 */
|
||||
private Long patientId;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
/** 请求签发时间 */
|
||||
private Date authoredTime;
|
||||
|
||||
/** 请求者 */
|
||||
private Long requesterId;
|
||||
|
||||
/** 执行者类型 */
|
||||
private String performerTypeCode;
|
||||
|
||||
/** 执行人 */
|
||||
private Long performerId;
|
||||
|
||||
/** 校对人 */
|
||||
private Long performerCheckId;
|
||||
|
||||
/** 校对时间 */
|
||||
private Date checkTime;
|
||||
|
||||
/** 执行位置 */
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 执行科室
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/** 理由 */
|
||||
private String reasonText;
|
||||
|
||||
/** 合同Id */
|
||||
private Long contractId;
|
||||
|
||||
/** 预计执行时间 */
|
||||
private Date occurrenceStartTime;
|
||||
|
||||
/** 预计结束 */
|
||||
private Date occurrenceEndTime;
|
||||
|
||||
/** 历史请求 */
|
||||
private Long relevantHistoryId;
|
||||
|
||||
/** 取消服务id */
|
||||
private Long refundServiceId;
|
||||
|
||||
/**
|
||||
* 请求内容json
|
||||
*/
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 类别医保编码
|
||||
*/
|
||||
private Integer ybClassEnum;
|
||||
|
||||
/**
|
||||
* 打印次数
|
||||
*/
|
||||
private Integer printCount;
|
||||
|
||||
/**
|
||||
* 诊断id
|
||||
*/
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/** 治疗类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/**
|
||||
* 签发编码
|
||||
*/
|
||||
private String signCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 供应发放管理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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 供应申请管理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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 供应申请管理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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ActivityDefinitionMapper extends BaseMapper<ActivityDefinition> {
|
||||
|
||||
/**
|
||||
* 查询指定诊疗的-诊疗定义id
|
||||
*
|
||||
* @param activityName 诊疗名称
|
||||
* @return 诊疗定义id
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(@Param("skinTestInspection") String skinTestInspection,
|
||||
@Param("status") Integer status);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
|
||||
/**
|
||||
* 器材发放管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface DeviceDispenseMapper extends BaseMapper<DeviceDispense> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
|
||||
/**
|
||||
* 器材请求管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface DeviceRequestMapper extends BaseMapper<DeviceRequest> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-05-07
|
||||
*/
|
||||
@Repository
|
||||
public interface ElepMedicationRequestMapper extends BaseMapper<ElepMedicationRequest> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
/**
|
||||
* 库存项目管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface InventoryItemMapper extends BaseMapper<InventoryItem> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ServiceRequestDetail;
|
||||
|
||||
/**
|
||||
* 服务申请详情管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ServiceRequestDetailMapper extends BaseMapper<ServiceRequestDetail> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
|
||||
/**
|
||||
* 服务申请管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface ServiceRequestMapper extends BaseMapper<ServiceRequest> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
|
||||
/**
|
||||
* 供应发放管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyDeliveryMapper extends BaseMapper<SupplyDelivery> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.openhis.workflow.domain.SupplyRequestAuto;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 供应申请管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyRequestAutoMapper extends BaseMapper<SupplyRequestAuto> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 供应申请管理Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyRequestMapper extends BaseMapper<SupplyRequest> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 器材发放管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
|
||||
/**
|
||||
* 处理器材发放信息
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
*/
|
||||
void handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
*
|
||||
* @param deviceReqId 器材请求id
|
||||
*/
|
||||
void deleteDeviceDispense(Long deviceReqId);
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
* @param devDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> devDisIdList, Integer refund);
|
||||
|
||||
/**
|
||||
* 获取执行过的器材数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
List<DeviceDispense> selectDeviceDispenseByBasedOnId(Long basedOnId);
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
*
|
||||
* @param deviceDispense 器材发放信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
* @param quantity 发药数量
|
||||
*/
|
||||
DeviceDispense createCompletedDeviceDispense(DeviceDispense deviceDispense, Date now, Practitioner loginUser,
|
||||
String step, Integer 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);
|
||||
|
||||
/**
|
||||
* 通过id获取耗材发放信息
|
||||
*
|
||||
* @param idList 发放id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<DeviceDispense> selectByIdList(@Param("idList") List<Long> idList);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
|
||||
import java.util.Date;
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
/**
|
||||
* 库存项目管理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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
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> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
|
||||
/**
|
||||
* 服务申请管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
|
||||
/**
|
||||
* 查询服务申请管理中basedOnId相同的个数
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
* @return basedOnId相同的个数
|
||||
*/
|
||||
Long countServiceRequestByBasedOnId(Long basedOnId);
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:停止
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
*/
|
||||
void updateStopRequestStatus(List<Long> serReqIdList);
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:完成
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
void updateCompleteRequestStatus(List<Long> serReqIdList, Long practitionerId, Date checkDate);
|
||||
|
||||
/**
|
||||
* 获取执行过的诊疗数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
List<ServiceRequest> selectServiceRequestByBasedOnId(Long basedOnId);
|
||||
|
||||
/**
|
||||
* 执行诊疗
|
||||
*
|
||||
* @param serviceRequest 服务申请信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
*/
|
||||
ServiceRequest createCompletedServiceRequest(ServiceRequest serviceRequest, Date now, Practitioner loginUser,
|
||||
String step);
|
||||
|
||||
/**
|
||||
* 服务申请状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean completedStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新服务申请状态:取消
|
||||
*
|
||||
* @param serviceReqId 服务请求id
|
||||
* @param now 更新时间
|
||||
* @param practitionerId 执行人
|
||||
* @param orgId 执行科室
|
||||
* @return 更新结果
|
||||
*/
|
||||
boolean updateCancelledStatus(Long serviceReqId, Date now, Long practitionerId, Long orgId);
|
||||
|
||||
/**
|
||||
* 服务申请状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
boolean activeStatusEnum(Long id, Date now, Practitioner loginUser);
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送(医嘱退回)
|
||||
*
|
||||
* @param serviceRequestIdList 请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate);
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送
|
||||
*
|
||||
* @param serReqIdList 请求id列表
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> serReqIdList);
|
||||
|
||||
/**
|
||||
* 更新服务申请里的打印次数字段
|
||||
*
|
||||
* @param id 服务申请id
|
||||
* @param num 打印次数
|
||||
* @return 更新结果
|
||||
*/
|
||||
void updateCountPint(Long id, Integer num);
|
||||
|
||||
/**
|
||||
* 根据药品请求id,查询对应的服务请求实体
|
||||
*
|
||||
* @param medRequestId 药品请求id
|
||||
* @return 服务请求实体
|
||||
*/
|
||||
ServiceRequest selectByMedRequestId(Long medRequestId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 供应发放管理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);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.domain.SupplyRequestAuto;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface ISupplyRequestAutoService extends IService<SupplyRequestAuto> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
|
||||
/**
|
||||
* 通过单据号查询单据信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
List<SupplyRequest> getSupplyByBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 通过原始单据号查询单据信息
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理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;
|
||||
}
|
||||
// 新增诊疗项目
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.utils.AssignSeqUtil;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.DbOpType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 器材发放管理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操作类型
|
||||
*/
|
||||
@Override
|
||||
public void 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(0);
|
||||
// 发药频次
|
||||
deviceDispense.setDispenseFrequencyCode(deviceRequest.getRateCode());
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加2小时
|
||||
LocalDateTime newTime = now.plusHours(2);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
deviceDispense.setLimitTime(limitTime);
|
||||
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
*
|
||||
* @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 basedOnId 请求基于什么的ID
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> selectDeviceDispenseByBasedOnId(Long basedOnId) {
|
||||
return (baseMapper
|
||||
.selectList(new LambdaQueryWrapper<DeviceDispense>().eq(DeviceDispense::getBasedOnId, basedOnId)
|
||||
.eq(DeviceDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行器材发放
|
||||
*
|
||||
* @param deviceDispense 器材发放信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
* @param quantity 发药数量
|
||||
*/
|
||||
@Override
|
||||
public DeviceDispense createCompletedDeviceDispense(DeviceDispense deviceDispense, Date now, Practitioner loginUser,
|
||||
String step, Integer 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);
|
||||
// 新增器材发放
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取耗材发放信息
|
||||
*
|
||||
* @param idList 发放id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceDispense> selectByIdList(@Param("idList") List<Long> idList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getId, idList)
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 器材请求管理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()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
|
||||
/**
|
||||
* 库存项目管理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.getValue())
|
||||
.eq(InventoryItem::getInventoryStatusEnum, PublicationStatus.ACTIVE.getValue());
|
||||
if (locationId != null) {
|
||||
queryWrapper.eq(InventoryItem::getLocationId, locationId);
|
||||
}
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 服务申请详情管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ServiceRequestDetailServiceImpl extends ServiceImpl<ServiceRequestDetailMapper, ServiceRequestDetail> implements IServiceRequestDetailService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.mapper.ServiceRequestMapper;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
* 服务申请管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper, ServiceRequest>
|
||||
implements IServiceRequestService {
|
||||
|
||||
/**
|
||||
* 查询服务申请管理中basedOnId相同的个数
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
* @return basedOnId相同的个数
|
||||
*/
|
||||
@Override
|
||||
public Long countServiceRequestByBasedOnId(Long basedOnId) {
|
||||
LambdaQueryWrapper<ServiceRequest> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ServiceRequest::getBasedOnId, basedOnId);
|
||||
return baseMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:停止
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateStopRequestStatus(List<Long> serReqIdList) {
|
||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.STOPPED.getValue()),
|
||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serReqIdList)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:完成
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCompleteRequestStatus(List<Long> serReqIdList, Long practitionerId, Date checkDate) {
|
||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.COMPLETED.getValue())
|
||||
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId()).setCheckTime(DateUtils.getNowDate()),
|
||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serReqIdList)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取执行过的诊疗数据
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
*/
|
||||
@Override
|
||||
public List<ServiceRequest> selectServiceRequestByBasedOnId(Long basedOnId) {
|
||||
return (baseMapper
|
||||
.selectList(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getBasedOnId, basedOnId)
|
||||
.eq(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行诊疗
|
||||
*
|
||||
* @param serviceRequest 服务申请信息
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
* @param step 执行次数
|
||||
*/
|
||||
@Override
|
||||
public ServiceRequest createCompletedServiceRequest(ServiceRequest serviceRequest, Date now, Practitioner loginUser,
|
||||
String step) {
|
||||
// 服务请求编码
|
||||
serviceRequest.setBusNo(serviceRequest.getBusNo() + "." + step);
|
||||
// 请求基于什么
|
||||
serviceRequest.setBasedOnTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);
|
||||
// 请求基于什么的ID
|
||||
serviceRequest.setBasedOnId(serviceRequest.getId());
|
||||
// 数量
|
||||
serviceRequest.setQuantity(1);
|
||||
// 状态
|
||||
serviceRequest.setStatusEnum(RequestStatus.COMPLETED.getValue());
|
||||
// 执行人
|
||||
serviceRequest.setPerformerId(loginUser.getId());
|
||||
// 执行位置
|
||||
serviceRequest.setLocationId(loginUser.getOrgId());
|
||||
// 预计执行时间
|
||||
serviceRequest.setOccurrenceStartTime(now);
|
||||
// id
|
||||
serviceRequest.setId(null);
|
||||
// 新增服务申请
|
||||
baseMapper.insert(serviceRequest);
|
||||
|
||||
return serviceRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务申请状态:已完成
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean completedStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getId, id).set(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue())
|
||||
.set(ServiceRequest::getPerformerId, loginUser.getId())
|
||||
.set(ServiceRequest::getLocationId, loginUser.getOrgId()).set(ServiceRequest::getOccurrenceStartTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务申请状态:取消
|
||||
*
|
||||
* @param serviceReqId 服务请求id
|
||||
* @param now 更新时间
|
||||
* @param practitionerId 执行人
|
||||
* @param orgId 执行科室
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateCancelledStatus(Long serviceReqId, Date now, Long practitionerId, Long orgId) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>().eq(ServiceRequest::getId, serviceReqId)
|
||||
.set(ServiceRequest::getStatusEnum, RequestStatus.CANCELLED.getValue())
|
||||
.set(ServiceRequest::getPerformerId, practitionerId).set(ServiceRequest::getOrgId, orgId)
|
||||
.set(ServiceRequest::getOccurrenceStartTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务申请状态:已发送
|
||||
*
|
||||
* @param id ID
|
||||
* @param now 当前时间
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
@Override
|
||||
public boolean activeStatusEnum(Long id, Date now, Practitioner loginUser) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getId, id).set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||
.set(ServiceRequest::getPerformerId, loginUser.getId())
|
||||
.set(ServiceRequest::getLocationId, loginUser.getOrgId()).set(ServiceRequest::getOccurrenceStartTime, now));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送(医嘱退回)
|
||||
*
|
||||
* @param serviceRequestIdList 请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate) {
|
||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.DRAFT.getValue())
|
||||
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId()).setCheckTime(DateUtils.getNowDate()),
|
||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serviceRequestIdList)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送
|
||||
*
|
||||
* @param serReqIdList 请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> serReqIdList) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>().set(ServiceRequest::getStatusEnum, RequestStatus.DRAFT.getValue())
|
||||
.in(ServiceRequest::getId, serReqIdList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新服务申请里的打印次数字段
|
||||
*
|
||||
* @param id 服务申请id
|
||||
* @param num 打印次数
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public void updateCountPint(Long id, Integer num) {
|
||||
// 根据 id 查询实体
|
||||
ServiceRequest serviceRequest = baseMapper.selectById(id);
|
||||
if (serviceRequest != null) {
|
||||
// 获取当前的 countPrint 值,如果为 null,默认为 0L
|
||||
int currentPrintCount = serviceRequest.getPrintCount();
|
||||
// 对 countPrint 字段进行加法操作
|
||||
int newPrintCount = currentPrintCount + num;
|
||||
// 更新实体
|
||||
serviceRequest.setPrintCount(newPrintCount);
|
||||
baseMapper.updateById(serviceRequest);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据药品请求id,查询对应的服务请求实体
|
||||
*
|
||||
* @param medRequestId 药品请求id
|
||||
* @return 服务请求实体
|
||||
*/
|
||||
@Override
|
||||
public ServiceRequest selectByMedRequestId(Long medRequestId) {
|
||||
|
||||
// 获取服务请求id
|
||||
// 创建 LambdaQueryWrapper
|
||||
LambdaQueryWrapper<ServiceRequest> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ServiceRequest::getBasedOnTable, CommonConstants.TableName.MED_MEDICATION_REQUEST)
|
||||
.eq(ServiceRequest::getBasedOnId, medRequestId).eq(ServiceRequest::getDeleteFlag, '0');
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
|
||||
/**
|
||||
* 供应发放管理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>().in(SupplyDelivery::getRequestId, supplyReqIdList));
|
||||
if (!deliveryList.isEmpty()) {
|
||||
List<Integer> deliveryStatusList =
|
||||
deliveryList.stream().map(SupplyDelivery::getStatusEnum).collect(Collectors.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()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.openhis.workflow.domain.SupplyRequestAuto;
|
||||
import com.openhis.workflow.mapper.SupplyRequestAutoMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestAutoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SupplyRequestAutoServiceImpl extends ServiceImpl<SupplyRequestAutoMapper, SupplyRequestAuto>
|
||||
implements ISupplyRequestAutoService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
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.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, SupplyRequest>
|
||||
implements ISupplyRequestService {
|
||||
|
||||
/**
|
||||
* 通过单据号查询单据信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByBusNo(String busNo) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过原始单据号查询单据信息
|
||||
*
|
||||
* @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()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过单据号删除单据信息
|
||||
*
|
||||
* @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()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user