完成100需求,补充99需求追溯术中产生的费用新增费用项时向表中插入SourceBillNo和generate_source_enum字段值

This commit is contained in:
chenjinyang
2026-02-10 16:49:28 +08:00
parent f1bddf3fbe
commit b5b91d8971
5 changed files with 882 additions and 50 deletions

View File

@@ -2,11 +2,14 @@ package com.openhis.web.clinicalmanage.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.core.common.core.domain.model.LoginUser;
import com.core.common.utils.SecurityUtils;
import com.openhis.web.clinicalmanage.appservice.ISurgicalScheduleAppService;
import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto;
import com.openhis.web.clinicalmanage.dto.OpScheduleDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.User;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -98,4 +101,29 @@ public class SurgicalScheduleController {
surgicalScheduleAppService.exportSurgerySchedule(opScheduleDto, response);
}
/**
* 验证密码
* @param password 密码
* @return 结果
*/
@PostMapping(value = "/checkPassword")
public R<?> checkPassword(@RequestParam String password) {
try {
//获取当前登录用户信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser == null) {
return R.fail("用户未登录");
}
// 直接使用 SecurityUtils.matchesPassword 进行密码验证
boolean isMatch = SecurityUtils.matchesPassword(password, loginUser.getPassword());
if (isMatch) {
return R.ok(true);
} else {
return R.fail("密码错误");
}
} catch (Exception e) {
return R.fail("密码验证失败:" + e.getMessage());
}
}
}

View File

@@ -635,6 +635,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
} else {
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue());
}
// 来源业务单据号:如果前端指定了来源业务单据号,设置该字段
if (adviceSaveDto.getSourceBillNo() != null) {
chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo());
}
chargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
@@ -652,10 +656,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
chargeItem.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
chargeItem.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
chargeItem.setDispenseId(dispenseId); // 发放ID
// 来源业务单据号:如果前端指定了来源业务单据号,设置该字段
if (adviceSaveDto.getSourceBillNo() != null) {
chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo());
}
chargeItem.setTenantId(tenantId); // 设置租户ID (修复本次报错)
chargeItem.setCreateBy(currentUsername); // 设置创建人
chargeItem.setCreateTime(curDate); // 设置创建时间
@@ -768,6 +768,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// 保存耗材费用项
chargeItem = new ChargeItem();
// 生成来源:如果前端指定了生成来源,使用前端值;否则使用默认的医生开立
if (adviceSaveDto.getGenerateSourceEnum() != null) {
chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum());
} else {
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue());
}
// 来源业务单据号:如果前端指定了来源业务单据号,设置该字段
if (adviceSaveDto.getSourceBillNo() != null) {
chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo());
}
chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id
chargeItem.setTenantId(tenantId); // 补全租户ID
chargeItem.setCreateBy(currentUsername); // 补全创建人
@@ -909,6 +919,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// 保存时保存诊疗费用项
if (is_save) {
chargeItem = new ChargeItem();
// 生成来源:如果前端指定了生成来源,使用前端值;否则使用默认的医生开立
if (adviceSaveDto.getGenerateSourceEnum() != null) {
chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum());
} else {
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue());
}
// 来源业务单据号:如果前端指定了来源业务单据号,设置该字段
if (adviceSaveDto.getSourceBillNo() != null) {
chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo());
}
chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id
chargeItem.setTenantId(tenantId); // 补全租户ID
chargeItem.setCreateBy(currentUsername); // 补全创建人