app新增患者逻辑修改

master
gongzhenkun 2 years ago
parent dd9c9b1ace
commit 390f4a406e

@ -4,6 +4,7 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.req.AppPatientReq;
import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.service.*; import com.ruoyi.system.service.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -144,8 +145,19 @@ public class AppController extends BaseController
*/ */
@ApiOperation("添加患者") @ApiOperation("添加患者")
@PostMapping("/addPatient") @PostMapping("/addPatient")
public AjaxResult addPatient(TPatient tPatient) { public AjaxResult addPatient(AppPatientReq tPatient)
return AjaxResult.success(tPatientService.insertTPatient(tPatient)); {
tPatientService.insertTPatient(tPatient);
TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor();
tPatientHospitalDoctor.setHospitalId(tPatient.getHospitalId());
tPatientHospitalDoctor.setDoctorId(tPatient.getDoctorId());
tPatientHospitalDoctor.setPatientId(tPatient.getId());
List<TPatientHospitalDoctor> tPatientHospitalDoctors = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor);
if (tPatientHospitalDoctors.isEmpty())
{
itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor);
}
return AjaxResult.success();
} }

@ -0,0 +1,45 @@
package com.ruoyi.system.domain.req;
import com.ruoyi.system.domain.TPatient;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* App
*
* @author gongzhenkun
* @date 2022/8/9 14:32
*/
@ApiModel(value = "AppPatientReq", description = "App端添加患者入参实体")
public class AppPatientReq extends TPatient
{
@NotNull(message = "doctorId不为空")
@ApiModelProperty("doctorId")
private Long doctorId;
@NotNull(message = "hospitalId不为空")
@ApiModelProperty("hospitalId")
private Long hospitalId;
public Long getDoctorId()
{
return doctorId;
}
public void setDoctorId(Long doctorId)
{
this.doctorId = doctorId;
}
public Long getHospitalId()
{
return hospitalId;
}
public void setHospitalId(Long hospitalId)
{
this.hospitalId = hospitalId;
}
}
Loading…
Cancel
Save