Fix: #333/#335/#336 添加医嘱保存参数校验
1. Bug #333/#335/#336: 在 saveAdvice 方法入口添加参数非空校验 - adviceSaveParam 为 null 时返回友好错误提示 - adviceSaveList 为 null 或空时返回友好错误提示 2. 更新 Debug 日志标签为 BugFix#333/335/336 3. 增强异常场景的用户提示 修复人:关羽 修复日期:2026-04-08
This commit is contained in:
@@ -492,13 +492,25 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> saveAdvice(AdviceSaveParam adviceSaveParam, String adviceOpType) {
|
||||
try {
|
||||
// 🔧 BugFix#333/335/336: 参数非空校验
|
||||
if (adviceSaveParam == null) {
|
||||
log.error("BugFix#333: adviceSaveParam 为 null");
|
||||
return R.fail(null, "请求参数为空,请刷新页面后重试");
|
||||
}
|
||||
|
||||
// 患者挂号对应的科室id
|
||||
Long organizationId = adviceSaveParam.getOrganizationId();
|
||||
// 医嘱分类信息
|
||||
List<AdviceSaveDto> adviceSaveList = adviceSaveParam.getAdviceSaveList();
|
||||
|
||||
// 🔧 BugFix#333: 医嘱列表非空校验
|
||||
if (adviceSaveList == null || adviceSaveList.isEmpty()) {
|
||||
log.error("BugFix#333: adviceSaveList 为 null 或空,adviceOpType={}", adviceOpType);
|
||||
return R.fail(null, "医嘱列表为空,请刷新页面后重试");
|
||||
}
|
||||
|
||||
// 🔍 Debug日志: 记录请求入口
|
||||
log.info("========== BugFix#219 DEBUG START ==========");
|
||||
log.info("========== BugFix#333/335/336 DEBUG START ==========");
|
||||
log.info("saveAdvice called, adviceOpType={}, organizationId={}, adviceSaveList.size={}",
|
||||
adviceOpType, organizationId, adviceSaveList != null ? adviceSaveList.size() : 0);
|
||||
if (adviceSaveList != null && !adviceSaveList.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user