Merge branch 'develop' of https://gitea.gentronhealth.com/wangyizhe/his into develop

This commit is contained in:
huhuihua
2026-01-23 13:58:25 +08:00
20 changed files with 400 additions and 439 deletions

View File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.core.domain.entity.SysDictData;
import com.core.common.core.domain.model.LoginUser;
import com.core.common.utils.*;
import com.core.common.utils.bean.BeanUtils;
import com.core.common.utils.poi.ExcelUtil;
@@ -400,6 +401,21 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
// 新增外来诊疗目录
activityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
// 显式设置创建者和租户ID确保插入时不为null
String createBy = "system";
Integer tenantId = null;
try {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
createBy = loginUser.getUsername();
tenantId = loginUser.getTenantId();
}
} catch (Exception e) {
// 如果获取失败,使用默认值
}
activityDefinition.setCreateBy(createBy);
activityDefinition.setTenantId(tenantId != null ? tenantId : 1); // 默认租户ID为1
// 检查编码是否已存在
List<ActivityDefinition> existingDefinitions = activityDefinitionMapper.selectList(
new LambdaQueryWrapper<ActivityDefinition>()
@@ -624,6 +640,20 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
// 显式设置创建者和租户ID确保插入时不为null
String createBy = "system";
Integer tenantId = null;
try {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
createBy = loginUser.getUsername();
tenantId = loginUser.getTenantId();
}
} catch (Exception e) {
// 如果获取失败,使用默认值
}
activityDefinition.setCreateBy(createBy);
activityDefinition.setTenantId(tenantId != null ? tenantId : 1); // 默认租户ID为1
return activityDefinition;
}
}

View File

@@ -123,6 +123,8 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
*/
@Override
public R<?> receiveEncounter(Long encounterId) {
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
String currentUsername = SecurityUtils.getUsername();
int update = encounterMapper.update(null,
new LambdaUpdateWrapper<Encounter>().eq(Encounter::getId, encounterId)
.set(Encounter::getReceptionTime, new Date())
@@ -140,6 +142,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
encounterParticipant.setTypeCode(ParticipantType.ADMITTER.getCode());// 接诊医生
encounterParticipant.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId());
encounterParticipant.setStatusEnum(EncounterActivityStatus.ACTIVE.getValue()); // 状态
encounterParticipant.setTenantId(tenantId);
encounterParticipant.setCreateBy(currentUsername);
encounterParticipant.setCreateTime(new Date());
iEncounterParticipantService.save(encounterParticipant);
return update > 0 ? R.ok() : R.fail();
}

View File

@@ -25,6 +25,7 @@ import com.openhis.web.inventorymanage.dto.*;
import com.openhis.web.inventorymanage.mapper.PurchaseInventoryMapper;
import com.openhis.workflow.domain.SupplyRequest;
import com.openhis.workflow.service.ISupplyRequestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -40,6 +41,7 @@ import java.util.stream.Stream;
* @author zwh
* @date 2025-03-08
*/
@Slf4j
@Service
public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppService {
@@ -159,6 +161,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
@Override
public R<List<ReceiptDetailDto>> getDetail(String busNo) {
List<ReceiptDetailDto> receiptDetailList = purchaseInventoryMapper.selectDetail(busNo);
log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList);
if (receiptDetailList.isEmpty()) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
}
@@ -182,7 +185,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
}
});
}
log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList);
return R.ok(receiptDetailList);
}
@@ -194,7 +197,6 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
*/
@Override
public R<?> addOrEditInventoryReceipt(List<PurchaseInventoryDto> purchaseInventoryDtoList) {
// 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求)
boolean validation = supplyRequestService.supplyRequestValidation(purchaseInventoryDtoList.get(0).getBusNo());
if (validation) {
@@ -232,11 +234,14 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
// 制单人
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
// 申请时间
.setApplyTime(DateUtils.getNowDate());
.setApplyTime(DateUtils.getNowDate())
.setCreateBy(SecurityUtils.getLoginUser().getUsername())
.setCreateTime(DateUtils.getNowDate())
.setTenantId(SecurityUtils.getLoginUser().getTenantId());
supplyRequestList.add(supplyRequest);
}
// 保存
supplyRequestService.saveOrUpdateBatch(supplyRequestList);

View File

@@ -57,15 +57,15 @@ public class PharmacyWarehouseProfitLossOrderServiceImpl implements IPharmacyWar
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption.add(new
// PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.GENERAL_PROFIT_AND_LOSS.getValue(),
// SupplyCategory.GENERAL_PROFIT_AND_LOSS.getInfo()));
// supplyCategoryOption.add(new
// PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.STOCKTAKING_PROFIT_AND_LOSS.getValue(),
// SupplyCategory.STOCKTAKING_PROFIT_AND_LOSS.getInfo()));
// supplyCategoryOption.add(new
// PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.PREPARATION_CONSUMPTION.getValue(),
// SupplyCategory.PREPARATION_CONSUMPTION.getInfo()));
supplyCategoryOption.add(new
PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.GENERAL_PROFIT_AND_LOSS.getValue(),
SupplyCategory.GENERAL_PROFIT_AND_LOSS.getInfo()));
supplyCategoryOption.add(new
PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.STOCKTAKING_PROFIT_AND_LOSS.getValue(),
SupplyCategory.STOCKTAKING_PROFIT_AND_LOSS.getInfo()));
supplyCategoryOption.add(new
PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.PREPARATION_CONSUMPTION.getValue(),
SupplyCategory.PREPARATION_CONSUMPTION.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);

View File

@@ -56,11 +56,11 @@ public class PharmacyWarehousePurchaseOrderServiceImpl implements IPharmacyWareh
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(),
// SupplyCategory.NORMAL.getInfo()));
// supplyCategoryOption.add(new
// PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.PURCHASE_PLAN_GENERATION.getValue(),
// SupplyCategory.PURCHASE_PLAN_GENERATION.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.STOCK_SUPPLY.getValue(),
SupplyCategory.STOCK_SUPPLY.getInfo()));
supplyCategoryOption.add(new
PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.NON_STOCK.getValue(),
SupplyCategory.NON_STOCK.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);

View File

@@ -56,8 +56,8 @@ public class PharmacyWarehouseReturnOrderServiceImpl implements IPharmacyWarehou
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(),
// SupplyCategory.NORMAL.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(),
SupplyCategory.NORMAL.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);

View File

@@ -56,8 +56,8 @@ public class PharmacyWarehouseReturnToWarehouseOrderServiceImpl implements IPhar
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(),
// SupplyCategory.NORMAL.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(),
SupplyCategory.NORMAL.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);

View File

@@ -57,18 +57,16 @@ public class PharmacyWarehouseStockInOrderServiceImpl implements IPharmacyWareho
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption
// .add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.PURCHASED_DRUGS_WAREHOUSING.getValue(),
// SupplyCategory.PURCHASED_DRUGS_WAREHOUSING.getInfo()));
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
// SupplyCategory.HOMEMADE_DRUGS_WAREHOUSING.getValue(), SupplyCategory.HOMEMADE_DRUGS_WAREHOUSING.getInfo()));
// supplyCategoryOption
// .add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.CONSIGNMENT_DRUGS_WAREHOUSING.getValue(),
// SupplyCategory.CONSIGNMENT_DRUGS_WAREHOUSING.getInfo()));
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
// SupplyCategory.OTHER_DRUGS_WAREHOUSING.getValue(), SupplyCategory.OTHER_DRUGS_WAREHOUSING.getInfo()));
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
// SupplyCategory.DONATED_DRUGS_WAREHOUSING.getValue(), SupplyCategory.DONATED_DRUGS_WAREHOUSING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.PURCHASED_DRUGS_WAREHOUSING.getValue(),
SupplyCategory.PURCHASED_DRUGS_WAREHOUSING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
SupplyCategory.HOMEMADE_DRUGS_WAREHOUSING.getValue(), SupplyCategory.HOMEMADE_DRUGS_WAREHOUSING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.CONSIGNMENT_DRUGS_WAREHOUSING.getValue(),
SupplyCategory.CONSIGNMENT_DRUGS_WAREHOUSING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
SupplyCategory.OTHER_DRUGS_WAREHOUSING.getValue(), SupplyCategory.OTHER_DRUGS_WAREHOUSING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
SupplyCategory.DONATED_DRUGS_WAREHOUSING.getValue(), SupplyCategory.DONATED_DRUGS_WAREHOUSING.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);

View File

@@ -56,12 +56,12 @@ public class PharmacyWarehouseStockOutOrderServiceImpl implements IPharmacyWareh
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.IN_HOSPITAL_OUTBOUND.getValue(),
// SupplyCategory.IN_HOSPITAL_OUTBOUND.getInfo()));
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getValue(),
// SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getInfo()));
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OTHER_OUTBOUND.getValue(),
// SupplyCategory.OTHER_OUTBOUND.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.IN_HOSPITAL_OUTBOUND.getValue(),
SupplyCategory.IN_HOSPITAL_OUTBOUND.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getValue(),
SupplyCategory.OUT_OF_HOSPITAL_OUTBOUND.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(SupplyCategory.OTHER_OUTBOUND.getValue(),
SupplyCategory.OTHER_OUTBOUND.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);

View File

@@ -57,10 +57,10 @@ public class PharmacyWarehouseStocktakingOrderServiceImpl implements IPharmacyWa
// 单据分类
List<PharmacyWarehouseInitDto.IntegerOption> supplyCategoryOption = new ArrayList<>();
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
// SupplyCategory.GENERAL_STOCKTAKING.getValue(), SupplyCategory.GENERAL_STOCKTAKING.getInfo()));
// supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
// SupplyCategory.MONTHLY_STOCKTAKING.getValue(), SupplyCategory.MONTHLY_STOCKTAKING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
SupplyCategory.GENERAL_STOCKTAKING.getValue(), SupplyCategory.GENERAL_STOCKTAKING.getInfo()));
supplyCategoryOption.add(new PharmacyWarehouseInitDto.IntegerOption(
SupplyCategory.MONTHLY_STOCKTAKING.getValue(), SupplyCategory.MONTHLY_STOCKTAKING.getInfo()));
purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption);