fix(order): 解决医嘱类型字段处理问题

- 优化了JSON解析逻辑,避免重复解析contentJson字段
- 确保therapyEnum字段正确传递,默认值设置为长期医嘱('1')
- 修复了医嘱保存和签发过程中类型字段丢失的问题
- 统一了前后端therapyEnum字段的默认值处理逻辑
- 添加了必要的注释说明字段处理规则
This commit is contained in:
2026-03-12 12:42:17 +08:00
parent cf3f971741
commit 4277a369d2
3 changed files with 29 additions and 9 deletions

View File

@@ -250,7 +250,8 @@ public class AdviceSaveDto {
*/
public AdviceSaveDto() {
this.chineseHerbsDoseQuantity = new BigDecimal("1");
this.therapyEnum = TherapyTimeType.TEMPORARY.getValue();
// 默认设置为长期医嘱,但前端应该明确传递正确的值
this.therapyEnum = TherapyTimeType.LONG_TERM.getValue();
this.practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
this.founderOrgId = SecurityUtils.getLoginUser().getOrgId(); // 开方人科室
}

View File

@@ -167,6 +167,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
Long organizationId = regAdviceSaveParam.getOrganizationId();
// 医嘱分类信息
List<RegAdviceSaveDto> regAdviceSaveList = regAdviceSaveParam.getRegAdviceSaveList();
// 药品
List<RegAdviceSaveDto> medicineList = regAdviceSaveList.stream()
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());