From 621b26cd05fae058797c9b736e2721db055b37a8 Mon Sep 17 00:00:00 2001 From: liyj <15602261488@163.com> Date: Sun, 22 Sep 2024 16:32:21 +0800 Subject: [PATCH] 1、获取时限方法修改 --- dyh-service/dyh-sys/src/main/java/cn/huge/module/sy/controller/client/SyTimeLimitClientController.java | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/sy/controller/client/SyTimeLimitClientController.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/sy/controller/client/SyTimeLimitClientController.java index b598003..83b47f7 100644 --- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/sy/controller/client/SyTimeLimitClientController.java +++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/sy/controller/client/SyTimeLimitClientController.java @@ -1,13 +1,16 @@ package cn.huge.module.sy.controller.client; +import cn.huge.base.common.utils.ObjectUtils; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; import cn.huge.module.sy.domain.po.SyTimeLimit; import cn.huge.module.sy.service.SyTimeLimitService; +import cn.huge.module.sys.dto.SyTimeLimitDTO; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.Map; /** @@ -187,19 +191,22 @@ } /** - * 条件分页查询 - * @url {ctx}/api/web/syTimeLimit/getTimeLimit - * @param limitTable 时限对应表 + * 获取时限 + * @url {ctx}/api/web/syTimeLimit/getExpireTime * @param limitType 时限类型 * @return Object */ - @GetMapping("/getTimeLimit") - public Object getTimeLimit(@RequestParam(value = "limitTable") int limitTable, @RequestParam(value = "limitType") int limitType) { + @GetMapping("/getExpireTime") + public Object getExpireTime(@RequestParam(value = "limitType") String limitType) { try { QueryWrapper<SyTimeLimit> syTimeLimitQueryWrapper = new QueryWrapper<>(); - syTimeLimitQueryWrapper.eq("limit_table", limitTable).eq("limit_type", limitType); + syTimeLimitQueryWrapper.eq("limit_type", limitType); SyTimeLimit syTimeLimit = service.getOne(syTimeLimitQueryWrapper); - return ReturnSucUtils.getRepInfo( "处理成功", syTimeLimit.getTimeTerm()); + SyTimeLimitDTO syTimeLimitDTO = new SyTimeLimitDTO(); + if (ObjectUtils.isNotEmpty(syTimeLimit)) { + BeanUtils.copyProperties(syTimeLimit, syTimeLimitDTO); + } + return ReturnSucUtils.getRepInfo(syTimeLimitDTO); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } -- Gitblit v1.8.0