From a6833a340fca8d3d447cc39c76437bf4a60aeefe Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 19 Aug 2022 17:35:41 +0800 Subject: [PATCH] =?UTF-8?q?App=E6=96=B0=E5=A2=9E=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 8b28ff4..09737a4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.RequestParamsUtil; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.http.HttpUtils; @@ -25,11 +26,8 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; -import sun.misc.BASE64Decoder; import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; @@ -501,4 +499,34 @@ public class AppController extends BaseController return jsonObject; } + + /** + * 添加记录 + * + * @param patientId 患者id + * @return {@code AjaxResult} + */ + @ApiOperation("新增预约记录") + @Log(title = "App新增预约记录", businessType = BusinessType.INSERT) + @PostMapping("/record/add/{patientId}") + public AjaxResult addRecord(@PathVariable Long patientId) + { + TRecord tRecord = new TRecord(); + tRecord.setHospitalId(SecurityUtils.getLoginUser().getUser().getHospitalId()); + tRecord.setPatientId(patientId); + tRecord.setDoctorId(getUserId()); + tRecord.setStatus("0"); + tRecord.setCreateBy(getUsername()); + tRecordService.insertTRecord(tRecord); + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + tPatientHospitalDoctor.setHospitalId(tRecord.getHospitalId()); + tPatientHospitalDoctor.setDoctorId(tRecord.getDoctorId()); + tPatientHospitalDoctor.setPatientId(tRecord.getPatientId()); + List tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); + if (tPHDs.isEmpty()) + { + itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor); + } + return AjaxResult.success("预约成功。"); + } }