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 1/3] =?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("预约成功。"); + } } From b5e4bb19d062451f03839405d71ea9c59ce4a695 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 19 Aug 2022 17:36:51 +0800 Subject: [PATCH 2/3] =?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=E5=8F=82=E6=95=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/web/controller/api/AppController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 09737a4..153ab6d 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 @@ -509,7 +509,7 @@ public class AppController extends BaseController @ApiOperation("新增预约记录") @Log(title = "App新增预约记录", businessType = BusinessType.INSERT) @PostMapping("/record/add/{patientId}") - public AjaxResult addRecord(@PathVariable Long patientId) + public AjaxResult addRecord(@PathVariable("patientId") Long patientId) { TRecord tRecord = new TRecord(); tRecord.setHospitalId(SecurityUtils.getLoginUser().getUser().getHospitalId()); From db6ae21589215582313932f261daaf6441188e72 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Fri, 19 Aug 2022 17:39:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/config/SecurityConfig.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 208cc36..71a4f66 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -20,7 +20,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; /** * spring security配置 - * + * * @author ruoyi */ @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @@ -31,7 +31,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter */ @Autowired private UserDetailsService userDetailsService; - + /** * 认证失败处理类 */ @@ -49,13 +49,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter */ @Autowired private JwtAuthenticationTokenFilter authenticationTokenFilter; - + /** * 跨域过滤器 */ @Autowired private CorsFilter corsFilter; - + /** * 解决 无法直接注入 AuthenticationManager * @@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/login/app","/login/app/fill/info","/register", "/captchaImage").anonymous() + .antMatchers("/login", "/login/app","/login/app/fill/info","/register", "/captchaImage","/common/upload").anonymous() .antMatchers( HttpMethod.GET, "/",