解决合并冲突
This commit is contained in:
@@ -170,4 +170,9 @@ public class DeviceRequest extends HisBaseEntity {
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
/**
|
||||
* 生成来源
|
||||
*/
|
||||
private Integer generateSourceEnum;
|
||||
}
|
||||
|
||||
@@ -89,9 +89,6 @@ public class InventoryItem extends HisBaseEntity {
|
||||
/** 追溯码包装层级 */
|
||||
private Integer packagingLevels;
|
||||
|
||||
/** 采购单价(包装单位) */
|
||||
private BigDecimal price;
|
||||
|
||||
public InventoryItem() {
|
||||
// 库存状态:启用
|
||||
this.inventoryStatusEnum = PublicationStatus.ACTIVE.getValue();
|
||||
|
||||
@@ -163,4 +163,9 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 生成来源
|
||||
*/
|
||||
private Integer generateSourceEnum;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.workflow.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/18 11:31
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ActivityDto {
|
||||
|
||||
private Long itemId;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.openhis.workflow.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @ClassName AdjustPriceDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/16 21:37
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdjustPriceDto {
|
||||
/**
|
||||
* 货品ID
|
||||
*/
|
||||
private Long itemId;
|
||||
/**
|
||||
* 剩余库存总数量
|
||||
*/
|
||||
private BigDecimal totalCount;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String itemTable;
|
||||
/**
|
||||
* 入库批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
/**
|
||||
* 仓库ID 如 药房一,药房二的ID
|
||||
*/
|
||||
private Long locationId;
|
||||
|
||||
private String unitCode;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.openhis.workflow.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePriceDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/19 10:02
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ChangePriceDto {
|
||||
|
||||
private Long chargeId;
|
||||
|
||||
private Long itemId;
|
||||
|
||||
private BigDecimal newPrice;
|
||||
|
||||
private String reason;
|
||||
|
||||
private BigDecimal quantity;
|
||||
|
||||
private Long supplyRequestId;
|
||||
|
||||
private BigDecimal retailPrice;
|
||||
private String itemTable;
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理Mapper接口
|
||||
@@ -23,5 +27,21 @@ public interface ActivityDefinitionMapper extends BaseMapper<ActivityDefinition>
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(@Param("activityName") String activityName,
|
||||
@Param("status") Integer status);
|
||||
/**
|
||||
* Desc: 根据 项目id数组 加载 诊疗数据集合
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 12:20 2025/10/18
|
||||
* @return java.util.List<com.openhis.workflow.domain.ActivityDefinition>
|
||||
**/
|
||||
List<ActivityDto> searchActivityDefinitionByIds(@Param("itemIds") List<Long> itemIds);
|
||||
/**
|
||||
* Desc: 根据关键字查询 如果关键字为空,查询10条,否则返回查询到的所有
|
||||
* @param keyWord
|
||||
* @Author raymond
|
||||
* @Date 07:53 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityListByKeyWord(@Param("keyWord") String keyWord);
|
||||
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
|
||||
/**
|
||||
* 库存项目管理Mapper接口
|
||||
@@ -13,5 +17,21 @@ import com.openhis.workflow.domain.InventoryItem;
|
||||
*/
|
||||
@Repository
|
||||
public interface InventoryItemMapper extends BaseMapper<InventoryItem> {
|
||||
/**
|
||||
* Desc: 根据 productIds 查询 库存大于0的 货品
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 21:56 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.dto.AdjustPriceDto>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataList(@Param("itemIds") List<Long> itemIds);
|
||||
/**
|
||||
* Desc: 根据 productIds 查询 库存大于0的 货品并分组查询
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 21:56 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.dto.AdjustPriceDto>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataListByGroup(@Param("itemIds") List<Long> itemIds);
|
||||
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.openhis.workflow.mapper;
|
||||
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.dto.ChangePriceDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应申请管理Mapper接口
|
||||
*
|
||||
@@ -13,5 +19,88 @@ import com.openhis.workflow.domain.SupplyRequest;
|
||||
*/
|
||||
@Repository
|
||||
public interface SupplyRequestMapper extends BaseMapper<SupplyRequest> {
|
||||
/**
|
||||
* Desc: 根据 调价单号 查询 supply request 和 价格主表
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:12 2025/10/19
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据 批次号查询 分组后的 产品ID
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:36 2025/10/30
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchGroupDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 med
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchMedInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 查询历史数据 药品调价数据
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 07:22 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryMedInfoData(@Param("busNo") String busNo, @Param("createTime")Date createTime);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 device
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 18:03 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchDeviceInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 查询历史数据 耗材调价数据
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 08:57 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryDeviceInfoDataForBusNo(@Param("busNo") String busNo,@Param("createTime") Date createTime);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 activity
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 18:03 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 activity
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:01 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryActivityInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 health
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 18:03 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHealthInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 health
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:00 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryHealthInfoDataForBusNo(@Param("busNo") String busNo);
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
|
||||
/**
|
||||
* 诊疗定义管理Service接口
|
||||
@@ -35,4 +41,20 @@ public interface IActivityDefinitionService extends IService<ActivityDefinition>
|
||||
*/
|
||||
Long getAppointActivityDefinitionId(String activityName);
|
||||
|
||||
/**
|
||||
* Desc: 根据 项目id数组 加载 诊疗数据集合
|
||||
* @param itemIds
|
||||
* @Author raymond
|
||||
* @Date 12:20 2025/10/18
|
||||
* @return java.util.List<com.openhis.workflow.domain.ActivityDefinition>
|
||||
**/
|
||||
List<ActivityDto> searchActivityDefinitionByIds(@Param("itemIds") List<Long> itemIds);
|
||||
/**
|
||||
* Desc: 根据关键字查询 如果关键字为空,查询10条,否则返回查询到的所有
|
||||
* @param keyWord
|
||||
* @Author raymond
|
||||
* @Date 07:53 2025/10/22
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityListByKeyWord(String keyWord);
|
||||
}
|
||||
@@ -17,13 +17,27 @@ import com.openhis.workflow.domain.DeviceRequest;
|
||||
*/
|
||||
public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
|
||||
|
||||
/**
|
||||
* 处理器材发放信息
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
* @return 发放id
|
||||
*/
|
||||
void handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType);
|
||||
Long handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 医嘱执行生成耗材发放,状态为待配药
|
||||
*
|
||||
* @param deviceRequest 耗材医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param locationId 发放器材房
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
Long generateDeviceDispense(DeviceRequest deviceRequest, Long procedureId, Long locationId,
|
||||
Date plannedDispenseTime);
|
||||
|
||||
/**
|
||||
* 删除器材发放信息
|
||||
@@ -107,4 +121,11 @@ public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
* @param devDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> devDispenseId);
|
||||
|
||||
/**
|
||||
* 更新耗材状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> medDispenseId, String busNo);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
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.workflow.domain.DeviceRequest;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 器材请求管理Service接口
|
||||
*
|
||||
@@ -45,4 +43,19 @@ public interface IDeviceRequestService extends IService<DeviceRequest> {
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> devReqIdList);
|
||||
|
||||
/**
|
||||
* 更新请求状态:取消
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
void updateCancelledStatusBatch(List<Long> devReqIdList);
|
||||
|
||||
/**
|
||||
* 获取耗材请求信息
|
||||
*
|
||||
* @param deviceId 耗材id
|
||||
* @return 耗材请求信息
|
||||
*/
|
||||
List<DeviceRequest> getDevRequestByDeviceId(Long deviceId);
|
||||
}
|
||||
@@ -3,9 +3,11 @@ package com.openhis.workflow.service;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service接口
|
||||
@@ -43,4 +45,34 @@ public interface IInventoryItemService extends IService<InventoryItem> {
|
||||
*/
|
||||
List<InventoryItem> selectInventoryByItemId(Long itemId, String lotNumber, Long locationId, Integer tenantId);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemIdList 项目编号列表
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<InventoryItem> selectInventoryByItemIdList(List<Long> itemIdList, Integer tenantId);
|
||||
|
||||
/**
|
||||
* Desc: 根据id 数组检索库存 > 0 的药品或耗材
|
||||
*
|
||||
* @param productIds
|
||||
* @Author raymond
|
||||
* @Date 16:45 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.domain.InventoryItem>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataList(List<Long> productIds);
|
||||
|
||||
/**
|
||||
* Desc: 根据id 数组检索库存 > 0 的药品或耗材并分组
|
||||
*
|
||||
* @param productIds
|
||||
* @Author raymond
|
||||
* @Date 16:45 2025/10/16
|
||||
* @return java.util.List<com.openhis.workflow.domain.InventoryItem>
|
||||
**/
|
||||
List<AdjustPriceDto> searchResultDataListByGroup(List<Long> productIds);
|
||||
|
||||
List<InventoryItem> selectAllInventory();
|
||||
}
|
||||
|
||||
@@ -112,11 +112,10 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
void updateCountPint(Long id, Integer num);
|
||||
|
||||
/**
|
||||
* 根据药品请求id,查询对应的服务请求实体
|
||||
*
|
||||
* @param medRequestId 药品请求id
|
||||
* @return 服务请求实体
|
||||
* 查询诊疗对应的服务申请
|
||||
*
|
||||
* @param activityId 诊疗id
|
||||
* @return 请求信息列表
|
||||
*/
|
||||
ServiceRequest selectByMedRequestId(Long medRequestId);
|
||||
|
||||
List<ServiceRequest> getServiceRequestByActivityId(Long activityId);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
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.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;
|
||||
|
||||
@@ -47,5 +46,44 @@ public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
||||
*/
|
||||
List<SupplyDelivery> selectByIdList(List<Long> deliveryIdList);
|
||||
|
||||
/**
|
||||
* 根据requestId,获取供应发放列表
|
||||
*
|
||||
* @param requestIdList requestId列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
List<SupplyDelivery> selectByRequestIdList(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* 创建待发药的供应发放
|
||||
*
|
||||
* @param medicationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param receiverId
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
void createSummarySupplyDelivery(Long medicationId, String lotNumber, Long patientId, BigDecimal minQuantity,
|
||||
String minUnitCode, Long receiverId, Long supplyRequestId);
|
||||
|
||||
/**
|
||||
* 创建已发放的供应发放(耗材)
|
||||
*
|
||||
* @param deviceId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
void createDeviceSummarySupplyDelivery(Long deviceId, String lotNumber, BigDecimal minQuantity, String minUnitCode,
|
||||
Long supplyRequestId);
|
||||
|
||||
/**
|
||||
* 根据供应申请id,删除供应发放
|
||||
*
|
||||
* @param requestIdList 供应申请id列表
|
||||
*/
|
||||
void deleteSupplyDeliveryByReqId(List<Long> requestIdList);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
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.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.dto.ChangePriceDto;
|
||||
|
||||
/**
|
||||
* 供应申请管理Service接口
|
||||
@@ -127,6 +128,7 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
* @return 校验结果
|
||||
*/
|
||||
boolean verifyAbleEdit(Long itemId);
|
||||
|
||||
/**
|
||||
* 通过单据号删除单据信息
|
||||
*
|
||||
@@ -140,6 +142,7 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
* @param supplyRequestIdList 供应申请id列表
|
||||
*/
|
||||
void updateCompletedStatusBatch(List<Long> supplyRequestIdList);
|
||||
|
||||
/**
|
||||
* 根据id,获取供应申请列表
|
||||
*
|
||||
@@ -147,4 +150,145 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
List<SupplyRequest> selectByIdList(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* Desc: 根据 调价单号 查询 supplyrequest 和 价格主表
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:13 2025/10/19
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param medicationId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
Long createSummarySupplyRequest(Long medicationId, Long locationId, String lotNumber, Long patientId,
|
||||
BigDecimal minQuantity, String minUnitCode, Long practitionerId, Date now, String busNo);
|
||||
|
||||
/**
|
||||
* 生成汇总发药单(耗材)
|
||||
*
|
||||
* @param deviceId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
Long createDeviceSummarySupplyRequest(Long deviceId, Long locationId, String lotNumber, BigDecimal minQuantity,
|
||||
String minUnitCode, Long practitionerId, Date now, String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 med
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchMedInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 查询历史数据 药品调价数据
|
||||
*
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 07:22 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryMedInfoData(String busNo, Date createTime);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 device
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchDeviceInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 查询历史数据 耗材调价数据
|
||||
*
|
||||
* @param busNo
|
||||
* @param createTime
|
||||
* @Author raymond
|
||||
* @Date 08:57 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryDeviceInfoDataForBusNo(String busNo, Date createTime);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 activity
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchActivityInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 activity
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:01 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryActivityInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 原价 health
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:10 2025/10/21
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHealthInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据调价单号 查询 历史原价 health
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 10:00 2025/10/29
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchHistoryHealthInfoDataForBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNoList 汇总单号
|
||||
* @return 处理结果
|
||||
*/
|
||||
List<Long> cancelSummarySupplyRequest(List<String> summaryNoList);
|
||||
|
||||
/**
|
||||
* Desc: 根据 批次号查询 分组后的 产品ID
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:36 2025/10/30
|
||||
* @return java.util.List<com.openhis.workflow.dto.ChangePriceDto>
|
||||
**/
|
||||
List<ChangePriceDto> searchGroupDataForBusNo(String busNo);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -68,4 +70,14 @@ public class ActivityDefinitionServiceImpl extends ServiceImpl<ActivityDefinitio
|
||||
return baseMapper.getAppointActivityDefinitionId(activityName, PublicationStatus.ACTIVE.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityDto> searchActivityDefinitionByIds(List<Long> itemIds) {
|
||||
return this.activityDefinitionMapper.searchActivityDefinitionByIds(itemIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchActivityListByKeyWord(String keyWord) {
|
||||
return this.activityDefinitionMapper.searchActivityListByKeyWord(keyWord);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,9 +42,10 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
*
|
||||
* @param deviceRequest 器材请求信息
|
||||
* @param dbOpType db操作类型
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public void handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType) {
|
||||
public Long handleDeviceDispense(DeviceRequest deviceRequest, String dbOpType) {
|
||||
DeviceDispense deviceDispense = new DeviceDispense();
|
||||
// 器材发放id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
@@ -92,6 +93,69 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
baseMapper.update(deviceDispense,
|
||||
new LambdaUpdateWrapper<DeviceDispense>().eq(DeviceDispense::getDeviceReqId, deviceRequest.getId()));
|
||||
}
|
||||
|
||||
return deviceDispense.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行生成耗材发放,状态为待配药
|
||||
*
|
||||
* @param deviceRequest 耗材医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param locationId 发放器材房
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public Long generateDeviceDispense(DeviceRequest deviceRequest, Long procedureId, Long locationId,
|
||||
Date plannedDispenseTime) {
|
||||
DeviceDispense deviceDispense = new DeviceDispense();
|
||||
// 执行id
|
||||
deviceDispense.setProcedureId(procedureId);
|
||||
// 预定发药时间
|
||||
deviceDispense.setPlannedDispenseTime(plannedDispenseTime);
|
||||
// 器材发放id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 器材请求id
|
||||
deviceDispense.setDeviceReqId(deviceRequest.getId());
|
||||
// 器材发放状态
|
||||
deviceDispense.setStatusEnum(DispenseStatus.PREPARATION.getValue());
|
||||
// 发药类型
|
||||
deviceDispense.setDispenseCategoryEnum(deviceRequest.getCategoryEnum());
|
||||
// 器材编码
|
||||
deviceDispense.setDeviceDefId(deviceRequest.getDeviceDefId());
|
||||
// 领药患者
|
||||
deviceDispense.setPatientId(deviceRequest.getPatientId());
|
||||
// 相关诊疗
|
||||
deviceDispense.setEncounterId(deviceRequest.getEncounterId());
|
||||
// 发放数量
|
||||
deviceDispense.setQuantity(deviceRequest.getQuantity());
|
||||
// 发放单位
|
||||
deviceDispense.setUnitCode(deviceRequest.getUnitCode());
|
||||
// 产品批号
|
||||
deviceDispense.setLotNumber(deviceRequest.getLotNumber());
|
||||
// 发药人
|
||||
deviceDispense.setPerformerId(deviceRequest.getPerformerId());
|
||||
// 发放器材房
|
||||
deviceDispense.setLocationId(locationId);
|
||||
// 支持用药信息
|
||||
deviceDispense.setSupportInfo(deviceRequest.getSupportInfo());
|
||||
// 已发药数量
|
||||
deviceDispense.setDispenseQuantity(BigDecimal.ZERO);
|
||||
// 发药频次
|
||||
deviceDispense.setDispenseFrequencyCode(deviceRequest.getRateCode());
|
||||
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 增加12小时
|
||||
LocalDateTime newTime = now.plusHours(12);
|
||||
// 转换为Date对象(如果需要保持使用Date类型)
|
||||
Date limitTime = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 设置限制发药时间
|
||||
deviceDispense.setLimitTime(limitTime);
|
||||
baseMapper.insert(deviceDispense);
|
||||
|
||||
return deviceDispense.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,4 +319,20 @@ public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper,
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
.in(DeviceDispense::getId, devDispenseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新耗材状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDispenseStatusSummarized(List<Long> medDispenseId, String busNo) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceDispense>()
|
||||
.set(DeviceDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
// TODO 数据库需要加字段
|
||||
// .set(DeviceDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
// .set(DeviceDispense::getSummaryNo, busNo)
|
||||
.in(DeviceDispense::getId, medDispenseId).eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ 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.administration.domain.Practitioner;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.mapper.DeviceRequestMapper;
|
||||
@@ -75,4 +77,27 @@ public class DeviceRequestServiceImpl extends ServiceImpl<DeviceRequestMapper, D
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.DRAFT.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请求状态:取消
|
||||
*
|
||||
* @param devReqIdList 耗材请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateCancelledStatusBatch(List<Long> devReqIdList) {
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList)
|
||||
.set(DeviceRequest::getStatusEnum, RequestStatus.CANCELLED.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取耗材请求信息
|
||||
*
|
||||
* @param deviceId 耗材id
|
||||
* @return 耗材请求信息
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceRequest> getDevRequestByDeviceId(Long deviceId) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<DeviceRequest>().eq(DeviceRequest::getDeviceDefId, deviceId)
|
||||
.eq(DeviceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,10 @@ package com.openhis.workflow.service.impl;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -75,4 +78,45 @@ public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, I
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param itemIdList 项目编号列表
|
||||
* @param tenantId 租户id
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<InventoryItem> selectInventoryByItemIdList(List<Long> itemIdList, Integer tenantId) {
|
||||
LambdaQueryWrapper<InventoryItem> queryWrapper =
|
||||
new LambdaQueryWrapper<InventoryItem>().in(InventoryItem::getItemId, itemIdList)
|
||||
.eq(InventoryItem::getTenantId, tenantId).eq(InventoryItem::getDeleteFlag, DelFlag.NO.getValue())
|
||||
.eq(InventoryItem::getInventoryStatusEnum, PublicationStatus.ACTIVE.getValue());
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public List<InventoryItem> selectAllInventory() {
|
||||
LambdaQueryWrapper<InventoryItem> queryWrapper =
|
||||
new LambdaQueryWrapper<InventoryItem>().eq(InventoryItem::getDeleteFlag, DelFlag.NO.getValue());
|
||||
// 查询取库房信息
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceDto> searchResultDataList(List<Long> productIds) {
|
||||
|
||||
return baseMapper.searchResultDataList(productIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceDto> searchResultDataListByGroup(List<Long> productIds) {
|
||||
return baseMapper.searchResultDataListByGroup(productIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,21 +215,14 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据药品请求id,查询对应的服务请求实体
|
||||
* 查询诊疗对应的服务申请
|
||||
*
|
||||
* @param medRequestId 药品请求id
|
||||
* @return 服务请求实体
|
||||
* @param activityId 诊疗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);
|
||||
|
||||
public List<ServiceRequest> getServiceRequestByActivityId(Long activityId) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getActivityId, activityId).eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -11,8 +12,10 @@ 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.constant.CommonConstants;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
||||
@@ -125,4 +128,65 @@ public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper,
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyDelivery>().in(SupplyDelivery::getId, deliveryIdList)
|
||||
.eq(SupplyDelivery::getDeleteFlag, DelFlag.YES.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据requestId,获取供应发放列表
|
||||
*
|
||||
* @param requestIdList requestId列表
|
||||
* @return 供应发放列表
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyDelivery> selectByRequestIdList(List<Long> requestIdList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyDelivery>()
|
||||
.in(SupplyDelivery::getRequestId, requestIdList).eq(SupplyDelivery::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建待发药的供应发放
|
||||
*
|
||||
* @param medicationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param receiverId
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
@Override
|
||||
public void createSummarySupplyDelivery(Long medicationId, String lotNumber, Long patientId, BigDecimal minQuantity,
|
||||
String minUnitCode, Long receiverId, Long supplyRequestId) {
|
||||
baseMapper.insert(new SupplyDelivery().setItemId(medicationId)
|
||||
.setItemTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION).setLotNumber(lotNumber)
|
||||
.setPatientId(patientId).setQuantity(minQuantity).setUnitCode(minUnitCode)
|
||||
.setTypeEnum(SupplyType.SUMMARY_DISPENSE.getValue()).setRequestId(supplyRequestId)
|
||||
.setStatusEnum(DispenseStatus.IN_PROGRESS.getValue()).setReceiverId(receiverId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建已发放的供应发放(耗材)
|
||||
*
|
||||
* @param deviceId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param supplyRequestId
|
||||
*/
|
||||
@Override
|
||||
public void createDeviceSummarySupplyDelivery(Long deviceId, String lotNumber, BigDecimal minQuantity,
|
||||
String minUnitCode, Long supplyRequestId) {
|
||||
baseMapper.insert(new SupplyDelivery().setItemId(deviceId)
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setLotNumber(lotNumber)
|
||||
.setQuantity(minQuantity).setUnitCode(minUnitCode).setTypeEnum(SupplyType.DEVICE_STOCKTAKING.getValue())
|
||||
.setRequestId(supplyRequestId).setStatusEnum(DispenseStatus.COMPLETED.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据供应申请id,删除供应发放
|
||||
*
|
||||
* @param requestIdList 供应申请id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteSupplyDeliveryByReqId(List<Long> requestIdList) {
|
||||
baseMapper.delete(new LambdaQueryWrapper<SupplyDelivery>().in(SupplyDelivery::getRequestId, requestIdList));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -11,9 +14,14 @@ 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.constant.CommonConstants;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.dto.ChangePriceDto;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
@@ -31,6 +39,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, SupplyRequest>
|
||||
implements ISupplyRequestService {
|
||||
@Resource
|
||||
private SupplyRequestMapper supplyRequestMapper;
|
||||
|
||||
/**
|
||||
* 通过单据号查询单据信息
|
||||
@@ -40,8 +50,7 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyRequest> getSupplyByBusNo(String busNo) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,7 +238,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
@Override
|
||||
public boolean verifyAbleEdit(Long itemId) {
|
||||
return baseMapper.exists(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getItemId, itemId)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.in(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue(), SupplyStatus.AGREE.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,4 +278,127 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getId, requestIdList)
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChangePriceDto> searchDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param medicationId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param patientId
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
@Override
|
||||
public Long createSummarySupplyRequest(Long medicationId, Long locationId, String lotNumber, Long patientId,
|
||||
BigDecimal minQuantity, String minUnitCode, Long practitionerId, Date now, String busNo) {
|
||||
SupplyRequest supplyRequest = new SupplyRequest().setItemId(medicationId).setSourceLocationId(locationId)
|
||||
.setLotNumber(lotNumber).setPatientId(patientId).setItemQuantity(minQuantity).setUnitCode(minUnitCode)
|
||||
.setApplicantId(practitionerId).setApplyTime(now).setBusNo(busNo)
|
||||
.setStatusEnum(SupplyStatus.SEND.getValue()).setTypeEnum(SupplyType.SUMMARY_DISPENSE.getValue())
|
||||
.setItemTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue());
|
||||
baseMapper.insert(supplyRequest);
|
||||
return supplyRequest.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成汇总发药单
|
||||
*
|
||||
* @param deviceId
|
||||
* @param locationId
|
||||
* @param lotNumber
|
||||
* @param minQuantity
|
||||
* @param minUnitCode
|
||||
* @param practitionerId
|
||||
* @param now
|
||||
* @param busNo
|
||||
*/
|
||||
@Override
|
||||
public Long createDeviceSummarySupplyRequest(Long deviceId, Long locationId, String lotNumber,
|
||||
BigDecimal minQuantity, String minUnitCode, Long practitionerId, Date now, String busNo) {
|
||||
SupplyRequest supplyRequest = new SupplyRequest().setItemId(deviceId).setSourceLocationId(locationId)
|
||||
.setLotNumber(lotNumber).setItemQuantity(minQuantity).setUnitCode(minUnitCode)
|
||||
.setApplicantId(practitionerId).setApplyTime(now).setBusNo(busNo)
|
||||
.setStatusEnum(SupplyStatus.SEND.getValue()).setTypeEnum(SupplyType.DEVICE_STOCKTAKING.getValue())
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue());
|
||||
baseMapper.insert(supplyRequest);
|
||||
return supplyRequest.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchMedInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchMedInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryMedInfoData(String busNo, Date createTime) {
|
||||
return this.supplyRequestMapper.searchHistoryMedInfoData(busNo, createTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchDeviceInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchDeviceInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryDeviceInfoDataForBusNo(String busNo, Date createTime) {
|
||||
return this.supplyRequestMapper.searchHistoryDeviceInfoDataForBusNo(busNo, createTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchActivityInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchActivityInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryActivityInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchHistoryActivityInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHealthInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchHealthInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchHistoryHealthInfoDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchHistoryHealthInfoDataForBusNo(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNoList 汇总单号
|
||||
* @return 汇总单ids
|
||||
*/
|
||||
@Override
|
||||
public List<Long> cancelSummarySupplyRequest(List<String> summaryNoList) {
|
||||
// 查询汇总发药单
|
||||
List<SupplyRequest> supplyRequestList =
|
||||
baseMapper.selectList(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getBusNo, summaryNoList)
|
||||
.eq(SupplyRequest::getTypeEnum, SupplyType.SUMMARY_DISPENSE.getValue())
|
||||
.eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
// 软删除汇总发药单
|
||||
baseMapper.delete(new LambdaQueryWrapper<SupplyRequest>().in(SupplyRequest::getBusNo, summaryNoList)
|
||||
.eq(SupplyRequest::getTypeEnum, SupplyType.SUMMARY_DISPENSE.getValue()));
|
||||
if (supplyRequestList != null && !supplyRequestList.isEmpty()) {
|
||||
return supplyRequestList.stream().map(SupplyRequest::getId).toList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChangePriceDto> searchGroupDataForBusNo(String busNo) {
|
||||
return this.supplyRequestMapper.searchGroupDataForBusNo(busNo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user