From 187de5833580f696949213d5dcf64a338ef5dad4 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Fri, 10 Jan 2025 14:38:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/home/LawController.java | 16 ++---- .../ruoyi/system/domain/SysSpecialDTO.java | 52 +++++++++++++++++++ .../ruoyi/system/mapper/SysSpecialMapper.java | 6 +++ .../system/service/ISysSpecialService.java | 6 +++ .../service/impl/SysSpecialServiceImpl.java | 6 +++ .../mapper/system/SysSpecialMapper.xml | 22 ++++++++ 6 files changed, 97 insertions(+), 11 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/SysSpecialDTO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/LawController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/LawController.java index 39bd8c3..18456f9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/LawController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/LawController.java @@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.system.domain.SysColumn; import com.ruoyi.system.domain.SysColumnVO; import com.ruoyi.system.domain.SysSpecial; +import com.ruoyi.system.domain.SysSpecialDTO; import com.ruoyi.system.service.ISysColumnService; import com.ruoyi.system.service.ISysSpecialService; import io.swagger.annotations.Api; @@ -75,17 +76,10 @@ public class LawController extends BaseController { @ApiOperation("专题活动") @GetMapping("/special") - public R> special(@RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false, defaultValue = PAGE_SIZE, value = "ps") Integer pageSize, - @RequestParam(required = false) String columnId, - @RequestParam(required = false) String specialTitle) { - PageMethod.startPage(pageNum, pageSize); - SysSpecial sysSpecial = new SysSpecial(); - sysSpecial.setStatus(STATUS); - sysSpecial.setColumnId(columnId); - sysSpecial.setSpecialTitle(specialTitle); - List specialList = specialService.selectSysSpecialList(sysSpecial); - PageInfo page = new PageInfo<>(specialList, pageSize); + public R> special(SysSpecialDTO sysSpecialDTO) { + PageMethod.startPage(sysSpecialDTO.getPageNum(), sysSpecialDTO.getPageSize()); + List specialList = specialService.selectSysSpecialDTOList(sysSpecialDTO); + PageInfo page = PageInfo.of(specialList); return R.ok(page); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysSpecialDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysSpecialDTO.java new file mode 100644 index 0000000..5fefe59 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysSpecialDTO.java @@ -0,0 +1,52 @@ +package com.ruoyi.system.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * ClassName: SysSpecialDTO + * Package: com.ruoyi.system.domain + * Description: + * + * @Author wangxy + * @Create 2025/1/10 14:18 + * @Version 1.0 + */ +@Data +public class SysSpecialDTO { + + /** 公告ID */ + private String specialId; + + /** 公告标题 */ + private String specialTitle; + + /** 公告内容 */ + private String specialContent; + + /** 公告状态(0正常 1关闭) */ + private String status = "0"; + + + private String columnId; + + /** 名称 */ + private String columnName; + + /** 创建者 */ + private String createBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + private Integer pageNum = 1; + + private Integer pageSize = 15; + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysSpecialMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysSpecialMapper.java index e15e2ce..8dddaa0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysSpecialMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysSpecialMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.system.mapper; import com.ruoyi.system.domain.SysSpecial; +import com.ruoyi.system.domain.SysSpecialDTO; import java.util.List; @@ -26,6 +27,11 @@ public interface SysSpecialMapper { */ public List selectSysSpecialList(SysSpecial special); + + + public List selectSysSpecialDTOList(SysSpecialDTO sysSpecialDTO); + + /** * 新增工作 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysSpecialService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysSpecialService.java index 8e58f5f..56783e1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysSpecialService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysSpecialService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service; import com.ruoyi.system.domain.SysSpecial; +import com.ruoyi.system.domain.SysSpecialDTO; import java.util.List; @@ -26,6 +27,11 @@ public interface ISysSpecialService { */ public List selectSysSpecialList(SysSpecial special); + + + + public List selectSysSpecialDTOList(SysSpecialDTO sysSpecialDTO); + /** * 新增工作 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSpecialServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSpecialServiceImpl.java index a2cc691..c979649 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSpecialServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysSpecialServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; import com.ruoyi.common.core.text.Convert; import com.ruoyi.system.domain.SysSpecial; +import com.ruoyi.system.domain.SysSpecialDTO; import com.ruoyi.system.mapper.SysSpecialMapper; import com.ruoyi.system.service.ISysSpecialService; import org.springframework.beans.factory.annotation.Autowired; @@ -44,6 +45,11 @@ public class SysSpecialServiceImpl implements ISysSpecialService { return specialMapper.selectSysSpecialList(special); } + @Override + public List selectSysSpecialDTOList(SysSpecialDTO sysSpecialDTO) { + return specialMapper.selectSysSpecialDTOList(sysSpecialDTO); + } + /** * 新增工作 * diff --git a/ruoyi-system/src/main/resources/mapper/system/SysSpecialMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysSpecialMapper.xml index 5a3e171..0113bbd 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysSpecialMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysSpecialMapper.xml @@ -52,6 +52,28 @@ order by create_time desc + + insert into sys_special ( special_id,