From fb9a66a663e82b9df6baabbbd41738abff9a2b7c Mon Sep 17 00:00:00 2001 From: fuhao Date: Thu, 5 Sep 2024 19:57:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=86=85=E5=AE=B9=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E4=B8=AD=E6=83=85=E6=8A=A5=E6=9D=BF=E4=BF=A1=E6=81=AF=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=BF=9E=E8=A1=A8=E6=9F=A5=E8=AF=A2):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../board/PresetContentController.java | 3 +- .../board/domain/dto/PresetContentDTO.java | 130 ++++++++++++++++++ .../board/service/IPresetContentService.java | 3 +- .../impl/PresetContentServiceImpl.java | 22 +-- 4 files changed, 146 insertions(+), 12 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/board/domain/dto/PresetContentDTO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/board/PresetContentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/board/PresetContentController.java index da0e6df5..c599d4c1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/board/PresetContentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/board/PresetContentController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.board; import com.ruoyi.board.domain.PresetContent; +import com.ruoyi.board.domain.dto.PresetContentDTO; import com.ruoyi.board.service.IPresetContentService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -37,7 +38,7 @@ public class PresetContentController extends BaseController public TableDataInfo list(PresetContent presetContent) { startPage(); - List list = presetContentService.listPage(presetContent); + List list = presetContentService.listDTO(presetContent); return getDataTable(list); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/board/domain/dto/PresetContentDTO.java b/ruoyi-system/src/main/java/com/ruoyi/board/domain/dto/PresetContentDTO.java new file mode 100644 index 00000000..081cfff8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/board/domain/dto/PresetContentDTO.java @@ -0,0 +1,130 @@ +package com.ruoyi.board.domain.dto; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.util.Date; + +@Data +public class PresetContentDTO { + /** + * 主键自增 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 预置信息名称 + */ + @TableField(value = "`name`") + private String name; + + /** + * 情报板尺寸 + */ + @TableField(value = "board_size") + private String boardSize; + + /** + * 信息类型 + */ + @TableField(value = "info_type") + private Integer infoType; + + /** + * 类型名称 + */ + private String typeName; + + /** + * 预置内容 + */ + @TableField(value = "content") + private String content; + + /** + * 预览路径 + */ + @TableField(value = "preview_path") + private String previewPath; + + /** + * 字体样式 + */ + @TableField(value = "font_style") + private String fontStyle; + + /** + * 字体大小 + */ + @TableField(value = "font_size") + private Integer fontSize; + + /** + * 字体间距 + */ + @TableField(value = "letter_spacing") + private Integer letterSpacing; + + /** + * 字体颜色 + */ + @TableField(value = "font_color") + private String fontColor; + + /** + * 字体坐标X + */ + @TableField(value = "font_position_x") + private Integer fontPositionX; + + /** + * 字体坐标Y + */ + @TableField(value = "font_position_y") + private Integer fontPositionY; + + /** + * 播放时间 + */ + @TableField(value = "play_time") + private Integer playTime; + + /** + * 当前预置类型 1:内置模版 0:预发布信息 + */ + @TableField(value = "preset_type") + private Integer presetType; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 创建时间 + */ + @TableField(value = "create_time") + private Date createTime; + + /** + * 更新时间 + */ + @TableField(value = "update_time") + private Date updateTime; + + /** + * 创建人id + */ + @TableField(value = "create_by") + private Integer createBy; + + /** + * 更新人id + */ + @TableField(value = "update_by") + private Integer updateBy; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/board/service/IPresetContentService.java b/ruoyi-system/src/main/java/com/ruoyi/board/service/IPresetContentService.java index b791b3b3..e1a0091c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/board/service/IPresetContentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/board/service/IPresetContentService.java @@ -2,6 +2,7 @@ package com.ruoyi.board.service; import com.github.yulichang.base.MPJBaseService; import com.ruoyi.board.domain.PresetContent; +import com.ruoyi.board.domain.dto.PresetContentDTO; import java.util.List; @@ -9,5 +10,5 @@ public interface IPresetContentService extends MPJBaseService { PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type); - List listPage(PresetContent presetContent); + List listDTO(PresetContent presetContent); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/board/service/impl/PresetContentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/board/service/impl/PresetContentServiceImpl.java index 4f264c1c..052ff645 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/board/service/impl/PresetContentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/board/service/impl/PresetContentServiceImpl.java @@ -2,12 +2,13 @@ package com.ruoyi.board.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.yulichang.base.MPJBaseServiceImpl; -import com.ruoyi.common.utils.StringUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.springframework.stereotype.Service; -import com.ruoyi.board.mapper.PresetContentMapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.ruoyi.board.domain.PlanType; import com.ruoyi.board.domain.PresetContent; +import com.ruoyi.board.domain.dto.PresetContentDTO; +import com.ruoyi.board.mapper.PresetContentMapper; import com.ruoyi.board.service.IPresetContentService; +import org.springframework.stereotype.Service; import java.util.List; @@ -24,11 +25,12 @@ public class PresetContentServiceImpl extends MPJBaseServiceImpl listPage(PresetContent presetContent) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.likeRight(StringUtils.isNotEmpty(presetContent.getName()), PresetContent::getName, presetContent.getName()); - queryWrapper.eq(StringUtils.isNotEmpty(presetContent.getBoardSize()), PresetContent::getBoardSize, presetContent.getBoardSize()); - queryWrapper.eq(ObjectUtils.isNotEmpty(presetContent.getInfoType()), PresetContent::getInfoType, presetContent.getInfoType()); - return list(queryWrapper); + public List listDTO(PresetContent presetContent) { + MPJLambdaWrapper eq = new MPJLambdaWrapper() + .selectAll(PresetContent.class) + .selectAs(PlanType::getTypeName, "type_name") + .leftJoin(PlanType.class, PlanType::getId, PresetContent::getInfoType) + .eq(presetContent.getInfoType() != null && presetContent.getInfoType() > 0, PresetContent::getInfoType, presetContent.getInfoType()); + return selectJoinList(PresetContentDTO.class, eq); } }