解决合并冲突
This commit is contained in:
@@ -168,4 +168,9 @@ public class MedicationDefinition extends HisBaseEntity {
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
* 用药说明
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
}
|
||||
@@ -215,4 +215,9 @@ public class MedicationDetail extends HisBaseEntity {
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/**
|
||||
* 用药说明
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ 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;
|
||||
@@ -126,4 +126,7 @@ public class MedicationDispense extends HisBaseEntity {
|
||||
|
||||
/** 执行id */
|
||||
private Long procedureId;
|
||||
|
||||
/** 汇总编号 */
|
||||
private String summaryNo;
|
||||
}
|
||||
|
||||
@@ -239,4 +239,14 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
|
||||
/** 请求基于什么的ID */
|
||||
private Long basedOnId;
|
||||
|
||||
/**
|
||||
* 用药说明
|
||||
*/
|
||||
private String dosageInstruction;
|
||||
|
||||
/**
|
||||
* 生成来源
|
||||
*/
|
||||
private Integer generateSourceEnum;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.openhis.medication.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @ClassName AdjustPriceMedListDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/20 09:58
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class AdjustPriceMedListDto {
|
||||
|
||||
/**
|
||||
* 表主表ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long targetId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String volume;
|
||||
/**
|
||||
* 原进货价
|
||||
*/
|
||||
private BigDecimal originBuyingPrice;
|
||||
/**
|
||||
* 原零售价
|
||||
*/
|
||||
private BigDecimal originRetailPrice;
|
||||
/**
|
||||
* 新进货价格
|
||||
*/
|
||||
private BigDecimal newBuyingPrice;
|
||||
/**
|
||||
* 新零售价
|
||||
*/
|
||||
private BigDecimal newRetailPrice;
|
||||
|
||||
/**
|
||||
* 调价原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 项目编码
|
||||
*/
|
||||
private String busNo;
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
private String unitCode;
|
||||
/**
|
||||
* 影响库存总数
|
||||
*/
|
||||
private BigDecimal totalQuantity;
|
||||
/**
|
||||
* 进价盈负差
|
||||
*/
|
||||
private BigDecimal buyingDifferencePrice;
|
||||
/**
|
||||
* 售价盈负差
|
||||
*/
|
||||
private BigDecimal retailDifferencePrice;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.openhis.medication.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@@ -22,4 +24,12 @@ public interface MedicationMapper extends BaseMapper<Medication> {
|
||||
* @return 药品详细信息列表
|
||||
*/
|
||||
List<MedicationDetail> selectDetailList();
|
||||
/**
|
||||
* Desc: 根据关键字查询 如果关键字为空,查询10条,否则返回查询到的所有
|
||||
* @param keyWord
|
||||
* @Author raymond
|
||||
* @Date 10:17 2025/10/20
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchMedListByKeyWord(@Param("keyWord") String keyWord);
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
@@ -21,16 +20,19 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
*
|
||||
* @param medicationRequest 药品请求信息
|
||||
* @param dbOpType db操作类型
|
||||
* @return 发放id
|
||||
*/
|
||||
void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType);
|
||||
Long handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType);
|
||||
|
||||
/**
|
||||
* 医嘱执行生成药品发放,状态为待配药
|
||||
*
|
||||
* @param medicationRequest 药品医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
void generateMedicationDispense(MedicationRequest medicationRequest,Long procedureId);
|
||||
Long generateMedicationDispense(MedicationRequest medicationRequest, Long procedureId, Date plannedDispenseTime);
|
||||
|
||||
/**
|
||||
* 删除药品发放信息
|
||||
@@ -77,20 +79,13 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
*/
|
||||
List<MedicationDispense> selectByRequestIdList(List<Long> requestIdList);
|
||||
|
||||
/**
|
||||
* 通过id获取药品发放信息
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> selectByIdList(@Param("idList") List<Long> idList);
|
||||
|
||||
/**
|
||||
* 更新药品状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
* @param busNo 汇总单号
|
||||
*/
|
||||
void updateDispenseStatusSummarized(List<Long> medDispenseId);
|
||||
void updateDispenseStatusSummarized(List<Long> medDispenseId, String busNo);
|
||||
|
||||
/**
|
||||
* 通过执行id获取药品发放信息
|
||||
@@ -99,4 +94,28 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> getMedDispenseByProcedureId(List<Long> procedureIdList);
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNoList 汇总单号列表
|
||||
* @return 取消结果
|
||||
*/
|
||||
boolean cancelMedicationSummary(List<String> summaryNoList);
|
||||
|
||||
/**
|
||||
* 更新药品发放状态
|
||||
*
|
||||
* @param dispenseIdList 发放id列表
|
||||
* @param dispenseStatus 发放状态
|
||||
*/
|
||||
void updateDispenseStatus(List<Long> dispenseIdList, Integer dispenseStatus);
|
||||
|
||||
/**
|
||||
* 通过汇总单号获取药品发放信息
|
||||
*
|
||||
* @param summaryNoList 汇总单号列表
|
||||
* @return 发放信息
|
||||
*/
|
||||
List<MedicationDispense> getMedDispenseBySummaryNo(List<String> summaryNoList);
|
||||
}
|
||||
@@ -3,8 +3,6 @@ package com.openhis.medication.service;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
@@ -35,10 +33,19 @@ public interface IMedicationRequestService extends IService<MedicationRequest> {
|
||||
void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate);
|
||||
|
||||
/**
|
||||
* 通过id获取药品请求信息
|
||||
* 更新请求状态:取消
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
* @param requestIdList 药品请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
List<MedicationRequest> selectByIdList(@Param("idList") List<Long> idList);
|
||||
void updateCancelledStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate);
|
||||
|
||||
/**
|
||||
* 根据药品id获取药品请求
|
||||
*
|
||||
* @param medicationId 药品id
|
||||
* @return 药品请求列表
|
||||
*/
|
||||
List<MedicationRequest> getMedRequestByMedicationId(Long medicationId);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDetail;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 药品基本信息管理Service接口
|
||||
@@ -31,5 +33,12 @@ public interface IMedicationService extends IService<Medication> {
|
||||
|
||||
// 新增药品目录
|
||||
boolean addMedication(MedicationDetail medicationDetail);
|
||||
|
||||
/**
|
||||
* Desc: 根据关键字查询 如果关键字为空,查询10条,否则返回查询到的所有
|
||||
* @param keyWord
|
||||
* @Author raymond
|
||||
* @Date 10:18 2025/10/20
|
||||
* @return java.util.List<com.openhis.medication.dto.AdjustPriceMedListDto>
|
||||
**/
|
||||
List<AdjustPriceMedListDto> searchMedListByKeyWord(String keyWord);
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -43,9 +42,10 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
*
|
||||
* @param medicationRequest 药品请求信息
|
||||
* @param dbOpType db操作类型
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public void handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType) {
|
||||
public Long handleMedicationDispense(MedicationRequest medicationRequest, String dbOpType) {
|
||||
MedicationDispense medicationDispense = new MedicationDispense();
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
@@ -103,19 +103,26 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
baseMapper.update(medicationDispense, new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.eq(MedicationDispense::getMedReqId, medicationRequest.getId()));
|
||||
}
|
||||
|
||||
return medicationDispense.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行生成药品发放,状态为待配药
|
||||
*
|
||||
*
|
||||
* @param medicationRequest 药品医嘱请求
|
||||
* @param procedureId 执行记录id
|
||||
* @param plannedDispenseTime 预定发药时间
|
||||
* @return 发放id
|
||||
*/
|
||||
@Override
|
||||
public void generateMedicationDispense(MedicationRequest medicationRequest, Long procedureId) {
|
||||
public Long generateMedicationDispense(MedicationRequest medicationRequest, Long procedureId,
|
||||
Date plannedDispenseTime) {
|
||||
MedicationDispense medicationDispense = new MedicationDispense();
|
||||
// 执行id
|
||||
medicationDispense.setProcedureId(procedureId);
|
||||
// 预定发药时间
|
||||
medicationDispense.setPlannedDispenseTime(plannedDispenseTime);
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 药品发放状态
|
||||
@@ -166,6 +173,8 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
medicationDispense.setLimitTime(limitTime);
|
||||
|
||||
baseMapper.insert(medicationDispense);
|
||||
|
||||
return medicationDispense.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,30 +256,19 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取药品发放信息
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationDispense> selectByIdList(@Param("idList") List<Long> idList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getId, idList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品状态:已汇总
|
||||
*
|
||||
* @param medDispenseId 发放id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateDispenseStatusSummarized(List<Long> medDispenseId) {
|
||||
public void updateDispenseStatusSummarized(List<Long> medDispenseId, String busNo) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.SUMMARIZED.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getId, medDispenseId));
|
||||
.set(MedicationDispense::getSummaryNo, busNo).in(MedicationDispense::getId, medDispenseId)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,4 +283,48 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getProcedureId, procedureIdList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消汇总
|
||||
*
|
||||
* @param summaryNoList 汇总单号
|
||||
* @return 取消结果
|
||||
*/
|
||||
@Override
|
||||
public boolean cancelMedicationSummary(List<String> summaryNoList) {
|
||||
int result = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.set(MedicationDispense::getSummaryNo, null).in(MedicationDispense::getSummaryNo, summaryNoList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新药品发放状态
|
||||
*
|
||||
* @param dispenseIdList 发放id列表
|
||||
* @param dispenseStatus 发放状态
|
||||
*/
|
||||
@Override
|
||||
public void updateDispenseStatus(List<Long> dispenseIdList, Integer dispenseStatus) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>().set(MedicationDispense::getStatusEnum, dispenseStatus)
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.in(MedicationDispense::getId, dispenseIdList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过汇总单号获取药品发放信息
|
||||
*
|
||||
* @param summaryNoList 汇总单号列表
|
||||
* @return 发放信息
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationDispense> getMedDispenseBySummaryNo(List<String> summaryNoList) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getSummaryNo, summaryNoList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.openhis.medication.service.impl;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -60,15 +59,36 @@ public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestM
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取药品请求信息
|
||||
* 更新请求状态:取消
|
||||
*
|
||||
* @param idList 请求id
|
||||
* @return 发放信息
|
||||
* @param requestIdList 药品请求id列表
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationRequest> selectByIdList(@Param("idList") List<Long> idList) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getId, idList)
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
public void updateCancelledStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate) {
|
||||
LambdaUpdateWrapper<MedicationRequest> updateWrapper =
|
||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.CANCELLED.getValue());
|
||||
if (practitionerId != null) {
|
||||
updateWrapper.set(MedicationRequest::getPerformerCheckId, practitionerId);
|
||||
}
|
||||
if (checkDate != null) {
|
||||
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
||||
}
|
||||
baseMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据药品id获取药品请求
|
||||
*
|
||||
* @param medicationId 药品id
|
||||
* @return 药品请求列表
|
||||
*/
|
||||
@Override
|
||||
public List<MedicationRequest> getMedRequestByMedicationId(Long medicationId) {
|
||||
return baseMapper
|
||||
.selectList(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getMedicationId, medicationId)
|
||||
.eq(MedicationRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.openhis.medication.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.medication.dto.AdjustPriceMedListDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -60,7 +63,7 @@ public class MedicationServiceImpl extends ServiceImpl<MedicationMapper, Medicat
|
||||
|
||||
/**
|
||||
* 新增药品目录
|
||||
*
|
||||
*
|
||||
* @param medicationDetail
|
||||
* @return
|
||||
*/
|
||||
@@ -83,4 +86,8 @@ public class MedicationServiceImpl extends ServiceImpl<MedicationMapper, Medicat
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdjustPriceMedListDto> searchMedListByKeyWord(String keyWord) {
|
||||
return this.medicationMapper.searchMedListByKeyWord(keyWord);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user