新增外贸接口,采购备注复制
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.export.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleCategoryVo;
|
||||
import com.ruoyi.export.domain.bo.ExportArticleCategoryBo;
|
||||
import com.ruoyi.export.service.IExportArticleCategoryService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/export/articleCategory")
|
||||
public class ExportArticleCategoryController extends BaseController {
|
||||
|
||||
private final IExportArticleCategoryService iExportArticleCategoryService;
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ExportArticleCategoryVo> list(ExportArticleCategoryBo bo, PageQuery pageQuery) {
|
||||
return iExportArticleCategoryService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文章分类列表
|
||||
*/
|
||||
@Log(title = "文章分类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ExportArticleCategoryBo bo, HttpServletResponse response) {
|
||||
List<ExportArticleCategoryVo> list = iExportArticleCategoryService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "文章分类", ExportArticleCategoryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章分类详细信息
|
||||
*
|
||||
* @param categoryId 主键
|
||||
*/
|
||||
@GetMapping("/{categoryId}")
|
||||
public R<ExportArticleCategoryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long categoryId) {
|
||||
return R.ok(iExportArticleCategoryService.queryById(categoryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章分类
|
||||
*/
|
||||
@Log(title = "文章分类", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ExportArticleCategoryBo bo) {
|
||||
return toAjax(iExportArticleCategoryService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类
|
||||
*/
|
||||
@Log(title = "文章分类", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ExportArticleCategoryBo bo) {
|
||||
return toAjax(iExportArticleCategoryService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分类
|
||||
*
|
||||
* @param categoryIds 主键串
|
||||
*/
|
||||
@Log(title = "文章分类", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{categoryIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] categoryIds) {
|
||||
return toAjax(iExportArticleCategoryService.deleteWithValidByIds(Arrays.asList(categoryIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.export.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleVo;
|
||||
import com.ruoyi.export.domain.bo.ExportArticleBo;
|
||||
import com.ruoyi.export.service.IExportArticleService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/export/article")
|
||||
public class ExportArticleController extends BaseController {
|
||||
|
||||
private final IExportArticleService iExportArticleService;
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ExportArticleVo> list(ExportArticleBo bo, PageQuery pageQuery) {
|
||||
return iExportArticleService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文章列表
|
||||
*/
|
||||
@Log(title = "文章", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ExportArticleBo bo, HttpServletResponse response) {
|
||||
List<ExportArticleVo> list = iExportArticleService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "文章", ExportArticleVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章详细信息
|
||||
*
|
||||
* @param articleId 主键
|
||||
*/
|
||||
@GetMapping("/{articleId}")
|
||||
public R<ExportArticleVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long articleId) {
|
||||
return R.ok(iExportArticleService.queryById(articleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章
|
||||
*/
|
||||
@Log(title = "文章", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ExportArticleBo bo) {
|
||||
return toAjax(iExportArticleService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章
|
||||
*/
|
||||
@Log(title = "文章", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ExportArticleBo bo) {
|
||||
return toAjax(iExportArticleService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*
|
||||
* @param articleIds 主键串
|
||||
*/
|
||||
@Log(title = "文章", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{articleIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] articleIds) {
|
||||
return toAjax(iExportArticleService.deleteWithValidByIds(Arrays.asList(articleIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.export.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.export.domain.vo.ExportCarouselVo;
|
||||
import com.ruoyi.export.domain.bo.ExportCarouselBo;
|
||||
import com.ruoyi.export.service.IExportCarouselService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 轮播图
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/export/carousel")
|
||||
public class ExportCarouselController extends BaseController {
|
||||
|
||||
private final IExportCarouselService iExportCarouselService;
|
||||
|
||||
/**
|
||||
* 查询轮播图列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ExportCarouselVo> list(ExportCarouselBo bo, PageQuery pageQuery) {
|
||||
return iExportCarouselService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出轮播图列表
|
||||
*/
|
||||
@Log(title = "轮播图", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ExportCarouselBo bo, HttpServletResponse response) {
|
||||
List<ExportCarouselVo> list = iExportCarouselService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "轮播图", ExportCarouselVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取轮播图详细信息
|
||||
*
|
||||
* @param carouselId 主键
|
||||
*/
|
||||
@GetMapping("/{carouselId}")
|
||||
public R<ExportCarouselVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long carouselId) {
|
||||
return R.ok(iExportCarouselService.queryById(carouselId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增轮播图
|
||||
*/
|
||||
@Log(title = "轮播图", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ExportCarouselBo bo) {
|
||||
return toAjax(iExportCarouselService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改轮播图
|
||||
*/
|
||||
@Log(title = "轮播图", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ExportCarouselBo bo) {
|
||||
return toAjax(iExportCarouselService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除轮播图
|
||||
*
|
||||
* @param carouselIds 主键串
|
||||
*/
|
||||
@Log(title = "轮播图", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{carouselIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] carouselIds) {
|
||||
return toAjax(iExportCarouselService.deleteWithValidByIds(Arrays.asList(carouselIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.export.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文章对象 export_article
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("export_article")
|
||||
public class ExportArticle extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 文章主键
|
||||
*/
|
||||
@TableId(value = "article_id")
|
||||
private Long articleId;
|
||||
/**
|
||||
* 所属文章分类ID
|
||||
*/
|
||||
private Long categoryId;
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
private String langCode;
|
||||
/**
|
||||
* SEO 友好链接
|
||||
*/
|
||||
private String slug;
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 摘要
|
||||
*/
|
||||
private String summary;
|
||||
/**
|
||||
* 文章内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 发布状态(0=未发布,1=已发布)
|
||||
*/
|
||||
private Integer isPublished;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date publishedTime;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.export.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文章分类对象 export_article_category
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("export_article_category")
|
||||
public class ExportArticleCategory extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 文章分类主键
|
||||
*/
|
||||
@TableId(value = "category_id")
|
||||
private Long categoryId;
|
||||
/**
|
||||
* 上级分类ID
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
private String langCode;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.export.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 轮播图对象 export_carousel
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("export_carousel")
|
||||
public class ExportCarousel extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 轮播图主键
|
||||
*/
|
||||
@TableId(value = "carousel_id")
|
||||
private Long carouselId;
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
private String langCode;
|
||||
/**
|
||||
* 轮播标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 轮播说明
|
||||
*/
|
||||
private String caption;
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
private String imageUrl;
|
||||
/**
|
||||
* 点击跳转 URL
|
||||
*/
|
||||
private String linkUrl;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.export.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文章业务对象 export_article
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ExportArticleBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 文章主键
|
||||
*/
|
||||
private Long articleId;
|
||||
|
||||
/**
|
||||
* 所属文章分类ID
|
||||
*/
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* SEO 友好链接
|
||||
*/
|
||||
private String slug;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 摘要
|
||||
*/
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 文章内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 发布状态(0=未发布,1=已发布)
|
||||
*/
|
||||
private Integer isPublished;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date publishedTime;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.export.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文章分类业务对象 export_article_category
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ExportArticleCategoryBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 文章分类主键
|
||||
*/
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 上级分类ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.export.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 轮播图业务对象 export_carousel
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ExportCarouselBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 轮播图主键
|
||||
*/
|
||||
private Long carouselId;
|
||||
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* 轮播标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 轮播说明
|
||||
*/
|
||||
private String caption;
|
||||
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 点击跳转 URL
|
||||
*/
|
||||
private String linkUrl;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
private Integer isEnabled;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.ruoyi.export.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 文章分类视图对象 export_article_category
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExportArticleCategoryVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 文章分类主键
|
||||
*/
|
||||
@ExcelProperty(value = "文章分类主键")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 上级分类ID
|
||||
*/
|
||||
@ExcelProperty(value = "上级分类ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
@ExcelProperty(value = "语言编码")
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@ExcelProperty(value = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 分类描述
|
||||
*/
|
||||
@ExcelProperty(value = "分类描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否启用", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0==否,1=是")
|
||||
private Integer isEnabled;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.ruoyi.export.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 文章视图对象 export_article
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExportArticleVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 文章主键
|
||||
*/
|
||||
@ExcelProperty(value = "文章主键")
|
||||
private Long articleId;
|
||||
|
||||
/**
|
||||
* 所属文章分类ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属文章分类ID")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
@ExcelProperty(value = "语言编码")
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* SEO 友好链接
|
||||
*/
|
||||
@ExcelProperty(value = "SEO 友好链接")
|
||||
private String slug;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
@ExcelProperty(value = "文章标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 摘要
|
||||
*/
|
||||
@ExcelProperty(value = "摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 文章内容
|
||||
*/
|
||||
@ExcelProperty(value = "文章内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 发布状态(0=未发布,1=已发布)
|
||||
*/
|
||||
@ExcelProperty(value = "发布状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0==未发布,1=已发布")
|
||||
private Integer isPublished;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@ExcelProperty(value = "发布时间")
|
||||
private Date publishedTime;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.ruoyi.export.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 轮播图视图对象 export_carousel
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExportCarouselVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 轮播图主键
|
||||
*/
|
||||
@ExcelProperty(value = "轮播图主键")
|
||||
private Long carouselId;
|
||||
|
||||
/**
|
||||
* 语言编码
|
||||
*/
|
||||
@ExcelProperty(value = "语言编码")
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* 轮播标题
|
||||
*/
|
||||
@ExcelProperty(value = "轮播标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 轮播说明
|
||||
*/
|
||||
@ExcelProperty(value = "轮播说明")
|
||||
private String caption;
|
||||
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
@ExcelProperty(value = "图片链接")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 点击跳转 URL
|
||||
*/
|
||||
@ExcelProperty(value = "点击跳转 URL")
|
||||
private String linkUrl;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否启用", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0==否,1=是")
|
||||
private Integer isEnabled;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.export.mapper;
|
||||
|
||||
import com.ruoyi.export.domain.ExportArticleCategory;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleCategoryVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 文章分类Mapper接口
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
public interface ExportArticleCategoryMapper extends BaseMapperPlus<ExportArticleCategoryMapper, ExportArticleCategory, ExportArticleCategoryVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.export.mapper;
|
||||
|
||||
import com.ruoyi.export.domain.ExportArticle;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 文章Mapper接口
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
public interface ExportArticleMapper extends BaseMapperPlus<ExportArticleMapper, ExportArticle, ExportArticleVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.export.mapper;
|
||||
|
||||
import com.ruoyi.export.domain.ExportCarousel;
|
||||
import com.ruoyi.export.domain.vo.ExportCarouselVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 轮播图Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
public interface ExportCarouselMapper extends BaseMapperPlus<ExportCarouselMapper, ExportCarousel, ExportCarouselVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.export.service;
|
||||
|
||||
import com.ruoyi.export.domain.ExportArticleCategory;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleCategoryVo;
|
||||
import com.ruoyi.export.domain.bo.ExportArticleCategoryBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类Service接口
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
public interface IExportArticleCategoryService {
|
||||
|
||||
/**
|
||||
* 查询文章分类
|
||||
*/
|
||||
ExportArticleCategoryVo queryById(Long categoryId);
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
TableDataInfo<ExportArticleCategoryVo> queryPageList(ExportArticleCategoryBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
List<ExportArticleCategoryVo> queryList(ExportArticleCategoryBo bo);
|
||||
|
||||
/**
|
||||
* 新增文章分类
|
||||
*/
|
||||
Boolean insertByBo(ExportArticleCategoryBo bo);
|
||||
|
||||
/**
|
||||
* 修改文章分类
|
||||
*/
|
||||
Boolean updateByBo(ExportArticleCategoryBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除文章分类信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.export.service;
|
||||
|
||||
import com.ruoyi.export.domain.ExportArticle;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleVo;
|
||||
import com.ruoyi.export.domain.bo.ExportArticleBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章Service接口
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
public interface IExportArticleService {
|
||||
|
||||
/**
|
||||
* 查询文章
|
||||
*/
|
||||
ExportArticleVo queryById(Long articleId);
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
TableDataInfo<ExportArticleVo> queryPageList(ExportArticleBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
List<ExportArticleVo> queryList(ExportArticleBo bo);
|
||||
|
||||
/**
|
||||
* 新增文章
|
||||
*/
|
||||
Boolean insertByBo(ExportArticleBo bo);
|
||||
|
||||
/**
|
||||
* 修改文章
|
||||
*/
|
||||
Boolean updateByBo(ExportArticleBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除文章信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.export.service;
|
||||
|
||||
import com.ruoyi.export.domain.ExportCarousel;
|
||||
import com.ruoyi.export.domain.vo.ExportCarouselVo;
|
||||
import com.ruoyi.export.domain.bo.ExportCarouselBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 轮播图Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
public interface IExportCarouselService {
|
||||
|
||||
/**
|
||||
* 查询轮播图
|
||||
*/
|
||||
ExportCarouselVo queryById(Long carouselId);
|
||||
|
||||
/**
|
||||
* 查询轮播图列表
|
||||
*/
|
||||
TableDataInfo<ExportCarouselVo> queryPageList(ExportCarouselBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询轮播图列表
|
||||
*/
|
||||
List<ExportCarouselVo> queryList(ExportCarouselBo bo);
|
||||
|
||||
/**
|
||||
* 新增轮播图
|
||||
*/
|
||||
Boolean insertByBo(ExportCarouselBo bo);
|
||||
|
||||
/**
|
||||
* 修改轮播图
|
||||
*/
|
||||
Boolean updateByBo(ExportCarouselBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除轮播图信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.ruoyi.export.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.export.domain.bo.ExportArticleCategoryBo;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleCategoryVo;
|
||||
import com.ruoyi.export.domain.ExportArticleCategory;
|
||||
import com.ruoyi.export.mapper.ExportArticleCategoryMapper;
|
||||
import com.ruoyi.export.service.IExportArticleCategoryService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 文章分类Service业务层处理
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ExportArticleCategoryServiceImpl implements IExportArticleCategoryService {
|
||||
|
||||
private final ExportArticleCategoryMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询文章分类
|
||||
*/
|
||||
@Override
|
||||
public ExportArticleCategoryVo queryById(Long categoryId){
|
||||
return baseMapper.selectVoById(categoryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ExportArticleCategoryVo> queryPageList(ExportArticleCategoryBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ExportArticleCategory> lqw = buildQueryWrapper(bo);
|
||||
Page<ExportArticleCategoryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章分类列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExportArticleCategoryVo> queryList(ExportArticleCategoryBo bo) {
|
||||
LambdaQueryWrapper<ExportArticleCategory> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ExportArticleCategory> buildQueryWrapper(ExportArticleCategoryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ExportArticleCategory> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getParentId() != null, ExportArticleCategory::getParentId, bo.getParentId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLangCode()), ExportArticleCategory::getLangCode, bo.getLangCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCategoryName()), ExportArticleCategory::getCategoryName, bo.getCategoryName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDescription()), ExportArticleCategory::getDescription, bo.getDescription());
|
||||
lqw.eq(bo.getSortOrder() != null, ExportArticleCategory::getSortOrder, bo.getSortOrder());
|
||||
lqw.eq(bo.getIsEnabled() != null, ExportArticleCategory::getIsEnabled, bo.getIsEnabled());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章分类
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ExportArticleCategoryBo bo) {
|
||||
ExportArticleCategory add = BeanUtil.toBean(bo, ExportArticleCategory.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setCategoryId(add.getCategoryId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章分类
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ExportArticleCategoryBo bo) {
|
||||
ExportArticleCategory update = BeanUtil.toBean(bo, ExportArticleCategory.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ExportArticleCategory entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章分类
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.ruoyi.export.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.export.domain.bo.ExportArticleBo;
|
||||
import com.ruoyi.export.domain.vo.ExportArticleVo;
|
||||
import com.ruoyi.export.domain.ExportArticle;
|
||||
import com.ruoyi.export.mapper.ExportArticleMapper;
|
||||
import com.ruoyi.export.service.IExportArticleService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 文章Service业务层处理
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ExportArticleServiceImpl implements IExportArticleService {
|
||||
|
||||
private final ExportArticleMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询文章
|
||||
*/
|
||||
@Override
|
||||
public ExportArticleVo queryById(Long articleId){
|
||||
return baseMapper.selectVoById(articleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ExportArticleVo> queryPageList(ExportArticleBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ExportArticle> lqw = buildQueryWrapper(bo);
|
||||
Page<ExportArticleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExportArticleVo> queryList(ExportArticleBo bo) {
|
||||
LambdaQueryWrapper<ExportArticle> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ExportArticle> buildQueryWrapper(ExportArticleBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ExportArticle> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getCategoryId() != null, ExportArticle::getCategoryId, bo.getCategoryId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLangCode()), ExportArticle::getLangCode, bo.getLangCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSlug()), ExportArticle::getSlug, bo.getSlug());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), ExportArticle::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSummary()), ExportArticle::getSummary, bo.getSummary());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), ExportArticle::getContent, bo.getContent());
|
||||
lqw.eq(bo.getIsPublished() != null, ExportArticle::getIsPublished, bo.getIsPublished());
|
||||
lqw.eq(bo.getPublishedTime() != null, ExportArticle::getPublishedTime, bo.getPublishedTime());
|
||||
lqw.eq(bo.getSortOrder() != null, ExportArticle::getSortOrder, bo.getSortOrder());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ExportArticleBo bo) {
|
||||
ExportArticle add = BeanUtil.toBean(bo, ExportArticle.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setArticleId(add.getArticleId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ExportArticleBo bo) {
|
||||
ExportArticle update = BeanUtil.toBean(bo, ExportArticle.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ExportArticle entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.export.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.export.domain.bo.ExportCarouselBo;
|
||||
import com.ruoyi.export.domain.vo.ExportCarouselVo;
|
||||
import com.ruoyi.export.domain.ExportCarousel;
|
||||
import com.ruoyi.export.mapper.ExportCarouselMapper;
|
||||
import com.ruoyi.export.service.IExportCarouselService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 轮播图Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-16
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ExportCarouselServiceImpl implements IExportCarouselService {
|
||||
|
||||
private final ExportCarouselMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询轮播图
|
||||
*/
|
||||
@Override
|
||||
public ExportCarouselVo queryById(Long carouselId){
|
||||
return baseMapper.selectVoById(carouselId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询轮播图列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ExportCarouselVo> queryPageList(ExportCarouselBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ExportCarousel> lqw = buildQueryWrapper(bo);
|
||||
Page<ExportCarouselVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询轮播图列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExportCarouselVo> queryList(ExportCarouselBo bo) {
|
||||
LambdaQueryWrapper<ExportCarousel> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ExportCarousel> buildQueryWrapper(ExportCarouselBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ExportCarousel> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLangCode()), ExportCarousel::getLangCode, bo.getLangCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), ExportCarousel::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCaption()), ExportCarousel::getCaption, bo.getCaption());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getImageUrl()), ExportCarousel::getImageUrl, bo.getImageUrl());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLinkUrl()), ExportCarousel::getLinkUrl, bo.getLinkUrl());
|
||||
lqw.eq(bo.getSortOrder() != null, ExportCarousel::getSortOrder, bo.getSortOrder());
|
||||
lqw.eq(bo.getIsEnabled() != null, ExportCarousel::getIsEnabled, bo.getIsEnabled());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增轮播图
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ExportCarouselBo bo) {
|
||||
ExportCarousel add = BeanUtil.toBean(bo, ExportCarousel.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setCarouselId(add.getCarouselId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改轮播图
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ExportCarouselBo bo) {
|
||||
ExportCarousel update = BeanUtil.toBean(bo, ExportCarousel.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ExportCarousel entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除轮播图
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.export.mapper.ExportArticleCategoryMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.export.domain.ExportArticleCategory" id="ExportArticleCategoryResult">
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="langCode" column="lang_code"/>
|
||||
<result property="categoryName" column="category_name"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="isEnabled" column="is_enabled"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.export.mapper.ExportArticleMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.export.domain.ExportArticle" id="ExportArticleResult">
|
||||
<result property="articleId" column="article_id"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="langCode" column="lang_code"/>
|
||||
<result property="slug" column="slug"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="summary" column="summary"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="isPublished" column="is_published"/>
|
||||
<result property="publishedTime" column="published_time"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.export.mapper.ExportCarouselMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.export.domain.ExportCarousel" id="ExportCarouselResult">
|
||||
<result property="carouselId" column="carousel_id"/>
|
||||
<result property="langCode" column="lang_code"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="caption" column="caption"/>
|
||||
<result property="imageUrl" column="image_url"/>
|
||||
<result property="linkUrl" column="link_url"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="isEnabled" column="is_enabled"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user