Эх сурвалжийг харах

新增预约H5查看预约信息

tjf 5 сар өмнө
parent
commit
628a814a4c

+ 9 - 16
ruoyi-admin/src/main/java/com/ruoyi/web/controller/appointment/BomanReservatConfigTimeController.java

@@ -1,26 +1,19 @@
 package com.ruoyi.web.controller.appointment;
 
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.BomanReservatConfigTime;
 import com.ruoyi.system.service.IBomanReservatConfigTimeService;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * 预约时段配置Controller
@@ -37,7 +30,7 @@ public class BomanReservatConfigTimeController extends BaseController {
     /**
      * 查询预约时段配置列表
      */
-    @PreAuthorize("@ss.hasPermi('system:time:list')")
+    //@PreAuthorize("@ss.hasPermi('system:time:list')")
     @GetMapping("/list")
     public TableDataInfo list(BomanReservatConfigTime bomanReservatConfigTime) {
         startPage();

+ 30 - 21
ruoyi-admin/src/main/java/com/ruoyi/web/controller/appointment/BomanReservatController.java

@@ -11,7 +11,6 @@ import com.ruoyi.system.service.IBomanReservatService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
-
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
@@ -23,31 +22,45 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/system/reservat")
-public class BomanReservatController extends BaseController
-{
+public class BomanReservatController extends BaseController {
     @Autowired
     private IBomanReservatService bomanReservatService;
 
-/**
- * 查询预约列表
- */
-@PreAuthorize("@ss.hasPermi('system:reservat:list')")
-@GetMapping("/list")
-    public TableDataInfo list(BomanReservat bomanReservat)
-    {
+    /**
+     * 查询预约列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:reservat:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BomanReservat bomanReservat) {
         startPage();
         List<BomanReservat> list = bomanReservatService.selectBomanReservatList(bomanReservat);
         return getDataTable(list);
     }
 
+    /**
+     * 查询预约列表
+     */
+    @GetMapping("/listNoPage")
+    public TableDataInfo listNoPage(BomanReservat bomanReservat) {
+        List<BomanReservat> list = bomanReservatService.selectBomanReservatList(bomanReservat);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取预约详细信息
+     */
+    @GetMapping(value = "/detail/{reservatId}")
+    public AjaxResult getInfoDetail(@PathVariable("reservatId") Long reservatId) {
+        return success(bomanReservatService.selectBomanReservatByReservatId(reservatId));
+    }
+
     /**
      * 导出预约列表
      */
     @PreAuthorize("@ss.hasPermi('system:reservat:export')")
     @Log(title = "预约", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, BomanReservat bomanReservat)
-    {
+    public void export(HttpServletResponse response, BomanReservat bomanReservat) {
         List<BomanReservat> list = bomanReservatService.selectBomanReservatList(bomanReservat);
         ExcelUtil<BomanReservat> util = new ExcelUtil<BomanReservat>(BomanReservat.class);
         util.exportExcel(response, list, "预约数据");
@@ -58,19 +71,17 @@ public class BomanReservatController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:reservat:query')")
     @GetMapping(value = "/{reservatId}")
-    public AjaxResult getInfo(@PathVariable("reservatId") Long reservatId)
-    {
+    public AjaxResult getInfo(@PathVariable("reservatId") Long reservatId) {
         return success(bomanReservatService.selectBomanReservatByReservatId(reservatId));
     }
 
     /**
      * 新增预约
      */
-    @PreAuthorize("@ss.hasPermi('system:reservat:add')")
+    //@PreAuthorize("@ss.hasPermi('system:reservat:add')")
     @Log(title = "预约", businessType = BusinessType.INSERT)
     @PostMapping("/add")
-    public AjaxResult add(@RequestBody BomanReservat bomanReservat)
-    {
+    public AjaxResult add(@RequestBody BomanReservat bomanReservat) {
         return toAjax(bomanReservatService.insertBomanReservat(bomanReservat));
     }
 
@@ -80,8 +91,7 @@ public class BomanReservatController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:reservat:edit')")
     @Log(title = "预约", businessType = BusinessType.UPDATE)
     @PostMapping("/put")
-    public AjaxResult edit(@RequestBody BomanReservat bomanReservat)
-    {
+    public AjaxResult edit(@RequestBody BomanReservat bomanReservat) {
         return toAjax(bomanReservatService.updateBomanReservat(bomanReservat));
     }
 
@@ -91,8 +101,7 @@ public class BomanReservatController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:reservat:remove')")
     @Log(title = "预约", businessType = BusinessType.DELETE)
     @GetMapping("/delete/{reservatIds}")
-    public AjaxResult remove(@PathVariable Long[] reservatIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] reservatIds) {
         return toAjax(bomanReservatService.deleteBomanReservatByReservatIds(reservatIds));
     }
 

+ 1 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -116,6 +116,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/system/app/new").permitAll()
                 .antMatchers("/real/time/getResult/**","/reservat/time/list","/system/dict/data/type/**","/system/reservat/add").permitAll()
+                .antMatchers("/system/reservat/detail/**","/system/reservat/listNoPage").permitAll()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
                 .and()