From 4e3455bfbe9b96c98350cea2c0988ec9c0e07ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Tue, 24 Sep 2024 10:17:21 +0800 Subject: [PATCH] =?UTF-8?q?cms=E4=BA=94=E6=8B=A6=E6=88=AA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E6=AF=94=E8=B5=9B=EF=BC=8C=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E6=AF=94=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/config/shiro/ShiroConfig.java | 4 +++- .../controller/AnnualCompPointController.java | 7 ++----- .../mapper/AnnualCompPointMapper.java | 4 ++-- .../service/IAnnualCompPointService.java | 2 +- .../impl/AnnualCompPointServiceImpl.java | 4 ++-- .../controller/AnnualCompController.java | 17 +++++++++++++++++ .../annualcomp/mapper/AnnualCompMapper.java | 3 +++ .../annualcomp/service/IAnnualCompService.java | 2 ++ .../service/impl/AnnualCompServiceImpl.java | 5 +++++ .../demo/comp/controller/CompController.java | 8 ++++++++ 10 files changed, 45 insertions(+), 11 deletions(-) diff --git a/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 9e840854..05195019 100644 --- a/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -75,7 +75,9 @@ public class ShiroConfig { } } // 配置不会被拦截的链接 顺序判断 - filterChainDefinitionMap.put("/AnnualCompPoint/annualCompPoint/findcompp", "anon"); //查询是已经通过审核的且在报名时间段之内的年度比赛项目 + filterChainDefinitionMap.put("/annualcomp/annualComp/findndbswlj", "anon"); //年度比赛列表无拦截需要传比赛id + filterChainDefinitionMap.put("/comp/comp/complistnolj", "anon"); //比赛列表无拦截 + filterChainDefinitionMap.put("/AnnualCompPoint/annualCompPoint/findcompp", "anon"); //查询是已经通过审核的且在报名时间段之内的年度比赛项目需要穿年度比赛id filterChainDefinitionMap.put("/sysconfiguration/sysConfiguration/**", "anon"); //系统配置 filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录 filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除 diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 55fecd3f..2d08767e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -1545,17 +1545,14 @@ public class AnnualCompPointController extends JeecgController findcompp(AnnualCompPoint annualCompPoint, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + public Result findcompp(@RequestParam(name = "id", required = true) String id) { // 获取当前时间 LocalDateTime now = LocalDateTime.now(); // 定义日期时间格式 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); // 格式化当前时间 String formattedNow = now.format(formatter); - List annualCompPointList = annualCompPointService.findcompp(formattedNow); + List annualCompPointList = annualCompPointService.findcompp(formattedNow,id); return Result.OK(annualCompPointList); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/mapper/AnnualCompPointMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/mapper/AnnualCompPointMapper.java index f87e41ea..c52d811f 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/mapper/AnnualCompPointMapper.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/mapper/AnnualCompPointMapper.java @@ -29,6 +29,6 @@ public interface AnnualCompPointMapper extends BaseMapper { @Select("select * from annual_comp_point where annual_comp_id =#{s}") List getannualCompPointList(String s); - @Select("SELECT * FROM annual_comp_point WHERE #{formattedNow} BETWEEN apply_start_time AND apply_end_time AND annual_comp_state = '2' AND annual_comp_switch = 'Y'") - List findcompp(String formattedNow); + @Select("SELECT * FROM annual_comp_point WHERE #{formattedNow} BETWEEN apply_start_time AND apply_end_time AND annual_comp_state = '2' AND annual_comp_switch = 'Y' AND annual_comp_id =#{id}") + List findcompp(String formattedNow,String id); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/IAnnualCompPointService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/IAnnualCompPointService.java index 19df2ccf..690adfc3 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/IAnnualCompPointService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/IAnnualCompPointService.java @@ -32,5 +32,5 @@ public interface IAnnualCompPointService extends IService { List getannualCompPointList(String s); // 查询是已经通过审核的且在报名时间段之内的年度比赛项目 - List findcompp(String formattedNow); + List findcompp(String formattedNow,String id); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java index 3d1f329d..ae504382 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java @@ -346,8 +346,8 @@ public class AnnualCompPointServiceImpl extends ServiceImpl findcompp(String formattedNow) { - return annualCompPointMapper.findcompp(formattedNow); + public List findcompp(String formattedNow,String id) { + return annualCompPointMapper.findcompp(formattedNow, id); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/controller/AnnualCompController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/controller/AnnualCompController.java index 9e8ea1ef..30a455f4 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/controller/AnnualCompController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/controller/AnnualCompController.java @@ -38,6 +38,8 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -570,5 +572,20 @@ public class AnnualCompController extends JeecgController findndbswlj(@RequestParam(name = "id", required = true) String id) { + // 获取当前时间 + LocalDateTime now = LocalDateTime.now(); + // 定义日期时间格式 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 格式化当前时间 + String formattedNow = now.format(formatter); + List annualComp = annualCompService.findndbswlj(formattedNow,id); + return Result.OK(annualComp); + } + + + } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/mapper/AnnualCompMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/mapper/AnnualCompMapper.java index 50cf013f..6dae3487 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/mapper/AnnualCompMapper.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/mapper/AnnualCompMapper.java @@ -22,4 +22,7 @@ public interface AnnualCompMapper extends BaseMapper { @Select("select * from annual_comp where compid =#{s}") List getannualcompidlist(String s); + + @Select("SELECT * FROM annual_comp WHERE #{formattedNow} BETWEEN starttime AND endtime AND state = 2 AND isopen = '1' AND compid =#{id}") + List findndbswlj(String formattedNow,String id); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/IAnnualCompService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/IAnnualCompService.java index a939f22d..ef499e7e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/IAnnualCompService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/IAnnualCompService.java @@ -16,4 +16,6 @@ public interface IAnnualCompService extends IService { List getannualcompid(String s); List getannualcompidlist(String s); + + List findndbswlj(String formattedNow,String id); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/impl/AnnualCompServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/impl/AnnualCompServiceImpl.java index f8177b89..05bffa6f 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/impl/AnnualCompServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/service/impl/AnnualCompServiceImpl.java @@ -32,4 +32,9 @@ public class AnnualCompServiceImpl extends ServiceImpl getannualcompidlist(String s) { return annualCompMapper.getannualcompidlist(s); } + + @Override + public List findndbswlj(String formattedNow,String id) { + return annualCompMapper.findndbswlj(formattedNow,id); + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java index 4a1d2820..87a56161 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java @@ -443,4 +443,12 @@ public class CompController extends JeecgController { return super.importExcel(request, response, Comp.class); } + @ApiOperation(value = "比赛列表无拦截", notes = "比赛列表无拦截") + @GetMapping(value = "/complistnolj") + public Result> complistnolj() { + List compList = compService.list(); + return Result.OK(compList); + } + + }