diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java index 5f46f79b..02db950b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java @@ -8,6 +8,7 @@ import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.dto.patientinfo.PatientBaseInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.service.patientinfo.IPatientInfoService; import io.swagger.annotations.Api; @@ -92,6 +93,17 @@ public class PatientInfoController extends BaseController { return R.ok(patientInfoService.updatePatientInfo(patientInfo)); } + /** + * 患者配置--修改患者信息 + */ + @ApiOperation("患者配置--修改患者信息") + @PreAuthorize("@ss.hasPermi('manage:patientInfo:edit')") + @Log(title = "患者信息", businessType = BusinessType.UPDATE) + @PutMapping("/updateBaseInfo") + public R updateBaseInfo(@RequestBody PatientBaseInfoDto patientInfo) { + return R.ok(patientInfoService.updateBaseInfo(patientInfo)); + } + /** * 删除患者信息 */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientvisitrecord/PatientVisitRecordController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientvisitrecord/PatientVisitRecordController.java index 27b6cb55..1e7848d4 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientvisitrecord/PatientVisitRecordController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientvisitrecord/PatientVisitRecordController.java @@ -93,7 +93,7 @@ public class PatientVisitRecordController extends BaseController { * 新增患者就诊记录基本信息 */ @ApiOperation("新增患者就诊记录基本信息") - @PreAuthorize("@ss.hasPermi('manage:visit:add')") + //@PreAuthorize("@ss.hasPermi('manage:visit:add')") @Log(title = "患者就诊记录基本信息", businessType = BusinessType.INSERT) @PostMapping public R add(@Valid @RequestBody PatientVisitRecordSaveDto patientVisitRecord) { @@ -105,7 +105,7 @@ public class PatientVisitRecordController extends BaseController { * 修改患者就诊记录基本信息 */ @ApiOperation("修改患者就诊记录基本信息") - @PreAuthorize("@ss.hasPermi('manage:visit:edit')") + //@PreAuthorize("@ss.hasPermi('manage:visit:edit')") @Log(title = "患者就诊记录基本信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Valid @RequestBody PatientVisitRecord patientVisitRecord) { @@ -116,7 +116,7 @@ public class PatientVisitRecordController extends BaseController { * 患者配置——就诊信息保存 */ @ApiOperation("患者配置——就诊信息保存") - @PreAuthorize("@ss.hasPermi('manage:visit:add')") + //@PreAuthorize("@ss.hasPermi('manage:visit:add')") @Log(title = "患者就诊记录基本信息", businessType = BusinessType.INSERT) @PostMapping("saveRecord") public R saveRecord(@Valid @RequestBody PatientVisitRecordInfoSaveDto saveDto) { @@ -129,7 +129,7 @@ public class PatientVisitRecordController extends BaseController { * 修改患者就诊记录基本信息 */ @ApiOperation("患者配置——就诊信息修改") - @PreAuthorize("@ss.hasPermi('manage:visit:edit')") + //@PreAuthorize("@ss.hasPermi('manage:visit:edit')") @Log(title = "患者就诊记录基本信息", businessType = BusinessType.UPDATE) @PutMapping("updateRecord") public AjaxResult updateRecord(@Valid @RequestBody PatientVisitRecordInfoSaveDto patientVisitRecord) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientinfo/PatientBaseInfoDto.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientinfo/PatientBaseInfoDto.java new file mode 100644 index 00000000..6023fbb0 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientinfo/PatientBaseInfoDto.java @@ -0,0 +1,79 @@ +package com.xinelu.manage.dto.patientinfo; + +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDate; +import lombok.Data; + +/** + * @description: 患者基本信息 + * @author: haown + * @create: 2024-05-08 09:10 + **/ +@Data +public class PatientBaseInfoDto { + + /** + * 主键id + */ + private Long id; + + /** + * 居民信息表id + */ + @ApiModelProperty(value = "居民信息表id") + private Long residentId; + + /** + * 患者姓名 + */ + @ApiModelProperty(value = "患者姓名") + private String patientName; + + /** + * 患者电话 + */ + @ApiModelProperty(value = "患者电话") + private String patientPhone; + + /** + * 家属电话 + */ + @ApiModelProperty(value = "家属电话") + private String familyMemberPhone; + + /** + * 出生日期,格式:yyyy-MM-dd + */ + @ApiModelProperty(value = "出生日期,格式:yyyy-MM-dd") + private LocalDate birthDate; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + private String cardNo; + + /** + * 性别,男:MALE,女:FEMALE + */ + @ApiModelProperty(value = "性别,男:MALE,女:FEMALE") + private String sex; + + /** + * 住址 + */ + @ApiModelProperty(value = "住址") + private String address; + + /** + * 所属医院id + */ + @ApiModelProperty(value = "所属医院id") + private Long hospitalAgencyId; + + /** + * 所属医院名称 + */ + @ApiModelProperty(value = "所属医院名称") + private String hospitalAgencyName; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java index 223979f0..b55a82f6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java @@ -1,6 +1,7 @@ package com.xinelu.manage.service.patientinfo; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.dto.patientinfo.PatientBaseInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import java.util.List; @@ -39,10 +40,18 @@ public interface IPatientInfoService { * 修改患者信息 * * @param patientInfo 患者信息 - * @return 结果 + * @return 患者信息 */ PatientInfo updatePatientInfo(PatientInfo patientInfo); + /** + * 患者基本信息 + * + * @param patientInfo 患者基本信息 + * @return 患者信息 + */ + PatientInfo updateBaseInfo(PatientBaseInfoDto patientInfo); + /** * 批量删除患者信息 * diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java index f66343fb..7f5551c8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java @@ -11,6 +11,7 @@ import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord; import com.xinelu.manage.domain.residentinfo.ResidentInfo; import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord; +import com.xinelu.manage.dto.patientinfo.PatientBaseInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.patientvisitrecord.PatientVisitRecordDto; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; @@ -144,12 +145,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService { throw new ServiceException("请输入身份证号"); } // 根据身份证号计算性别出生日期 - if (patientInfo.getBirthDate() == null) { - patientInfo.setBirthDate(BaseUtil.getBirthday(patientInfo.getCardNo())); - } - if (StringUtils.isBlank(patientInfo.getSex())) { - patientInfo.setSex(BaseUtil.getGender(patientInfo.getCardNo())); - } + patientInfo.setBirthDate(BaseUtil.getBirthday(patientInfo.getCardNo())); + patientInfo.setSex(BaseUtil.getGender(patientInfo.getCardNo())); ResidentInfo residentInfo = new ResidentInfo(); if (patientInfo.getResidentId() != null) { residentInfo = residentInfoMapper.selectResidentInfoById(patientInfo.getResidentId()); @@ -187,7 +184,13 @@ public class PatientInfoServiceImpl implements IPatientInfoService { return patientInfo; } - /** + @Override public PatientInfo updateBaseInfo(PatientBaseInfoDto patientInfo) { + PatientInfo patientInfo1 = patientInfoMapper.selectPatientInfoById(patientInfo.getId()); + BeanUtils.copyBeanProp(patientInfo1, patientInfo); + return updatePatientInfo(patientInfo1); + } + + /** * 批量删除患者信息 * * @param ids 需要删除的患者信息主键