diff --git a/src/main/java/com/huoran/iasf/controller/SysColumnController.java b/src/main/java/com/huoran/iasf/controller/SysColumnController.java index c4c60ea..31915ba 100644 --- a/src/main/java/com/huoran/iasf/controller/SysColumnController.java +++ b/src/main/java/com/huoran/iasf/controller/SysColumnController.java @@ -6,7 +6,8 @@ import com.huoran.iasf.common.utils.Constant; import com.huoran.iasf.entity.ColumnEntity; import com.huoran.iasf.entity.SysColumn; import com.huoran.iasf.entity.SysContent; -import com.huoran.iasf.service.SysContentService; +import com.huoran.iasf.entity.SysTemplateStyle; +import com.huoran.iasf.service.*; import com.huoran.iasf.vo.req.ColumnWeightReqVO; import com.huoran.iasf.vo.req.PaginationColumnReqVO; import com.huoran.iasf.vo.resp.SortColumnRespVO; @@ -22,12 +23,13 @@ import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.RequestParam; import io.swagger.annotations.ApiOperation; -import com.huoran.iasf.service.SysColumnService; import javax.validation.Valid; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; /** @@ -46,6 +48,13 @@ public class SysColumnController { @Autowired public SysContentService contentService; + @Autowired + public SysTemplateService templateService; + + @Autowired + public SysTemplateStyleService styleService; + @Autowired + public SysTemplateStyleConfigurationService templateStyleConfigurationService; @PostMapping("/listWithTree") @ApiOperation(value = "栏目树结构", response = SysColumn.class) @@ -64,6 +73,12 @@ public class SysColumnController { @ApiOperation(value = "查询详情", response = SysColumn.class) public R findById(@RequestParam("id") @ApiParam(value = "序号") Integer id) { SysColumn sysColumn = service.getById(id); + SysTemplateStyle sysTemplateStyle = styleService.getById(sysColumn.getListStyleId()); + + if (sysTemplateStyle.getPath() != null) { + sysColumn.setPath(sysTemplateStyle.getPath()); + } + return R.success(sysColumn); } @@ -74,7 +89,7 @@ public class SysColumnController { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("father_id", sysColumn.getFatherId()); Integer count = service.count(queryWrapper); - sysColumn.setSort(count+1); + sysColumn.setSort(count + 1); boolean addState = service.save(sysColumn); return addState ? R.success(sysColumn.getId()) : R.fail("新增失败"); } @@ -124,18 +139,6 @@ public class SysColumnController { SysColumn sysColumn = new SysColumn(); BeanUtils.copyProperties(sort, sysColumn); service.updateById(sysColumn); - //依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id - /*QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("column_id", sysColumn.getId()); - List contentList = contentService.list(queryWrapper); - if (contentList.size() > 0) { - for (SysContent content : contentList) { - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("column_id", sysColumn.getId()); - contentService.update(content, updateWrapper); - } - }*/ - } return R.success(); @@ -145,6 +148,14 @@ public class SysColumnController { @PostMapping("/getsTheSubColumn") public R getsTheSubColumn(Integer id) { + String ids = this.getIds(id); + + return service.getsTheSubColumn(id, ids); + + } + + + public String getIds(Integer id) { //1 创建list集合,用于封装所有删除菜单id值 List idList = new ArrayList<>(); //2 向idList集合设置删除菜单id @@ -156,9 +167,7 @@ public class SysColumnController { str += idstr + ","; } String ids = str.substring(0, str.length() - 1); - - return service.getsTheSubColumn(id, ids); - + return ids; } public void selectCategoryChildById(String id, List idList) { @@ -178,5 +187,28 @@ public class SysColumnController { } + @ApiOperation("获取一级下的子级栏目以及下的全部文章标签") + @PostMapping("/getTheFullArticleByColumn") + public R getTheFullArticleByColumn(@ApiParam(name = "id", value = "一级栏目id", required = true) @RequestParam Integer id) { + String ids = this.getIds(id); + return contentService.getTheFullArticleByColumn(ids); + } + + + @ApiOperation("获取子级栏目id") + @PostMapping("/getsTheChildColumnId") + public R getsTheSublevelColumnIdOfTheNextLevel(@ApiParam(name = "id", value = "一级栏目id", required = true) @RequestParam Integer id) { + //1 创建list集合,用于封装所有删除菜单id值 + List idList = new ArrayList<>(); + //2 向idList集合设置删除菜单id + this.selectCategoryChildById(id + "", idList);//找到当前菜单的子菜单 把结果id封装到idlist里面去 + //把当前id封装到list里面 + idList.add(id);//现在把当前id封装进去 之前都是子菜单的id + return R.success(idList); + + } + + + } diff --git a/src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java b/src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java index f8ed41c..c7c5190 100644 --- a/src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java +++ b/src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java @@ -38,8 +38,10 @@ public class SysContentClassificationController { @PostMapping("/allTheQuery") @ApiOperation(value = "查询全部文章所属分类", response = SysContentClassification.class) - public R allTheQuery(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId) { - List list = service.list(new QueryWrapper().eq("site_id", siteId)); + public R allTheQuery(@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId, + @ApiParam(name = "templateId", value = "模板id", required = true) @RequestParam Integer templateId) { + List list = service.list(new QueryWrapper() + .eq("site_id", siteId).eq("template_id",templateId)); return R.success(list); } diff --git a/src/main/java/com/huoran/iasf/controller/SysContentController.java b/src/main/java/com/huoran/iasf/controller/SysContentController.java index a072c3a..d44a2f1 100644 --- a/src/main/java/com/huoran/iasf/controller/SysContentController.java +++ b/src/main/java/com/huoran/iasf/controller/SysContentController.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.huoran.iasf.entity.SysColumn; import com.huoran.iasf.entity.SysContentFile; import com.huoran.iasf.service.SysColumnService; +import com.huoran.iasf.service.SysContentFileService; import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO; import com.huoran.iasf.vo.req.ContentReq; import com.huoran.iasf.vo.req.PageContentReqVO; @@ -44,6 +45,10 @@ public class SysContentController { @Autowired public SysColumnService columnService; + @Autowired + public SysContentFileService fileService; + + @PostMapping("/pagingQuery") @ApiOperation(value = "分页查询", response = PageContentRespVO.class) public R pagingQuery(@RequestBody @Valid @ApiParam(name = "分页查询参数", value = "传入json格式", required = true) PageContentReqVO sysContent) { @@ -51,19 +56,17 @@ public class SysContentController { } - - - @PostMapping("/findById") @ApiOperation(value = "查询详情", response = SysContent.class) public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { SysContent sysContent = service.getById(id); SysColumn sysColumn = columnService.getById(sysContent.getColumnId()); - if (sysColumn.getColumnName()!=null){ + if (sysColumn.getColumnName() != null) { sysContent.setColumnName(sysColumn.getColumnName()); } - + List fileList = fileService.getFileByContentId(id); + sysContent.setFileList(fileList); return R.success(sysContent); } @@ -92,7 +95,6 @@ public class SysContentController { } - @PostMapping("/batchDeletion") @ApiOperation(value = "批量删除文章", response = SysContent.class) public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List ids) { @@ -123,30 +125,29 @@ public class SysContentController { /** * 获取栏目下的文章 + * * @param pageReq * @return */ @PostMapping("/getColumnArticles") - @ApiOperation(value = "获取栏目下的文章",response = SysContent.class) + @ApiOperation(value = "获取栏目下的文章", response = SysContent.class) public R getColumnArticles(@RequestBody @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) ContentReq pageReq) { IPage page = new Page(pageReq.getPageNum(), pageReq.getPageSize()); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("column_id",pageReq.getColumnIds()); - IPage iPage = service.page(page,queryWrapper); + queryWrapper.in("column_id", pageReq.getColumnIds()); + IPage iPage = service.page(page, queryWrapper); return R.success(iPage); } - @PostMapping("/articleEnableOrDisable") - @ApiOperation(value = "文章启用禁用",response = SysContent.class) - public R articleEnableOrDisable(@ApiParam(name = "id", value = "文章id", required = true) @RequestParam Integer id, - @ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { + @ApiOperation(value = "文章启用禁用", response = SysContent.class) + public R articleEnableOrDisable(@ApiParam(name = "id", value = "文章id", required = true) @RequestParam Integer id, @ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("is_disable",isDisable); - updateWrapper.eq("id",id); - boolean ret = service.update(updateWrapper); - return ret?R.success():R.fail("禁用/启用失败"); + updateWrapper.set("is_disable", isDisable); + updateWrapper.eq("id", id); + boolean ret = service.update(updateWrapper); + return ret ? R.success() : R.fail("禁用/启用失败"); } } diff --git a/src/main/java/com/huoran/iasf/entity/SysContent.java b/src/main/java/com/huoran/iasf/entity/SysContent.java index b1abf6a..aaedd74 100644 --- a/src/main/java/com/huoran/iasf/entity/SysContent.java +++ b/src/main/java/com/huoran/iasf/entity/SysContent.java @@ -7,6 +7,7 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Date; +import java.util.List; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -154,4 +155,8 @@ public class SysContent implements Serializable { @ApiModelProperty(value = "栏目名称") @TableField(exist = false) private String columnName; + + @ApiModelProperty(value = "文章附件") + @TableField(exist = false) + List fileList; } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysContentClassification.java b/src/main/java/com/huoran/iasf/entity/SysContentClassification.java index 551dd91..9913341 100644 --- a/src/main/java/com/huoran/iasf/entity/SysContentClassification.java +++ b/src/main/java/com/huoran/iasf/entity/SysContentClassification.java @@ -53,5 +53,9 @@ public class SysContentClassification implements Serializable { @NotNull(message = "站点id不能为空!") private Integer siteId; + @ApiModelProperty(value = "模板id(用于区分哪个模板下的分类)") + @NotNull(message = "模板id不能为空!") + private Integer templateId; + } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/entity/SysTemplateStyleConfiguration.java b/src/main/java/com/huoran/iasf/entity/SysTemplateStyleConfiguration.java index b3ddd9c..3781d96 100644 --- a/src/main/java/com/huoran/iasf/entity/SysTemplateStyleConfiguration.java +++ b/src/main/java/com/huoran/iasf/entity/SysTemplateStyleConfiguration.java @@ -2,7 +2,9 @@ package com.huoran.iasf.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; + import java.io.Serializable; + import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -17,21 +19,21 @@ import lombok.EqualsAndHashCode; * @since 2022-11-24 */ @Data - @EqualsAndHashCode(callSuper = false) - @ApiModel(value="SysTemplateStyleConfiguration对象", description="栏目样式、列表样式、详情样式配置表") +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "SysTemplateStyleConfiguration对象", description = "栏目样式、列表样式、详情样式配置表") public class SysTemplateStyleConfiguration implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; - @ApiModelProperty(value = "栏目id") - private Integer templateId; + @ApiModelProperty(value = "模板id") + private Integer templateId; - @ApiModelProperty(value = "样式id") - private Integer styleId; + @ApiModelProperty(value = "样式id") + private Integer styleId; } diff --git a/src/main/java/com/huoran/iasf/mapper/SysContentFileMapper.java b/src/main/java/com/huoran/iasf/mapper/SysContentFileMapper.java index b8b63b4..4d3120a 100644 --- a/src/main/java/com/huoran/iasf/mapper/SysContentFileMapper.java +++ b/src/main/java/com/huoran/iasf/mapper/SysContentFileMapper.java @@ -3,6 +3,9 @@ package com.huoran.iasf.mapper; import com.huoran.iasf.entity.SysContentFile; import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @描述:文章附件管理表 Mapper 接口 @@ -11,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ @Mapper public interface SysContentFileMapper extends BaseMapper { - + List getFileByContentId(@Param("contentId") Integer contentId); } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java b/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java index d61fc62..bdb0e15 100644 --- a/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java +++ b/src/main/java/com/huoran/iasf/mapper/SysContentMapper.java @@ -2,7 +2,10 @@ package com.huoran.iasf.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.iasf.common.utils.R; import com.huoran.iasf.entity.SysContent; +import com.huoran.iasf.entity.SysContentClassification; +import com.huoran.iasf.entity.SysContentLabel; import com.huoran.iasf.vo.req.PageContentReqVO; import com.huoran.iasf.vo.resp.PageContentRespVO; import org.apache.ibatis.annotations.Mapper; @@ -21,4 +24,6 @@ public interface SysContentMapper extends BaseMapper { IPage articlePaginationList(Page page, @Param("req") PageContentReqVO req); IPage getPublishedArticles(Page page, @Param("req") PageContentReqVO req); + + List useTheColumnToGetTagsForTheFullArticle(String ids); } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysContentFileMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysContentFileMapper.xml index c5aa3e3..32101c1 100644 --- a/src/main/java/com/huoran/iasf/mapper/xml/SysContentFileMapper.xml +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysContentFileMapper.xml @@ -16,5 +16,14 @@ + \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml index 2a43901..2a9c491 100644 --- a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml @@ -39,9 +39,11 @@ ORDER BY c.create_time desc + + + + \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysColumnService.java b/src/main/java/com/huoran/iasf/service/SysColumnService.java index 4e5fe85..6912fb6 100644 --- a/src/main/java/com/huoran/iasf/service/SysColumnService.java +++ b/src/main/java/com/huoran/iasf/service/SysColumnService.java @@ -32,4 +32,8 @@ public interface SysColumnService extends IService { R getsTheSubColumn(Integer parentId,String ids); + + + + } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysContentFileService.java b/src/main/java/com/huoran/iasf/service/SysContentFileService.java index 27d6295..10effc4 100644 --- a/src/main/java/com/huoran/iasf/service/SysContentFileService.java +++ b/src/main/java/com/huoran/iasf/service/SysContentFileService.java @@ -3,6 +3,8 @@ package com.huoran.iasf.service; import com.huoran.iasf.entity.SysContentFile; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @描述:文章附件管理表 service接口 * @作者: Rong @@ -10,5 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface SysContentFileService extends IService { + List getFileByContentId(Integer contentId); } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/SysContentService.java b/src/main/java/com/huoran/iasf/service/SysContentService.java index 705ed61..5513b0e 100644 --- a/src/main/java/com/huoran/iasf/service/SysContentService.java +++ b/src/main/java/com/huoran/iasf/service/SysContentService.java @@ -22,4 +22,6 @@ public interface SysContentService extends IService { //查询已发布的、启用了的文章列表 R publishedEnabledArticles(); + + R getTheFullArticleByColumn(String ids); } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/impl/SysContentFileServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysContentFileServiceImpl.java index 43efa74..11bcbf4 100644 --- a/src/main/java/com/huoran/iasf/service/impl/SysContentFileServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/SysContentFileServiceImpl.java @@ -8,6 +8,7 @@ import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; +import java.util.List; /** * @描述:文章附件管理表 服务类 @@ -20,6 +21,10 @@ public class SysContentFileServiceImpl extends ServiceImpl getFileByContentId(Integer contentId) { + return baseMapper.getFileByContentId(contentId); + } } diff --git a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java index 11d110d..48c0e52 100644 --- a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java @@ -15,7 +15,7 @@ import com.huoran.iasf.vo.resp.PageContentRespVO; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; -import java.util.List; +import java.util.*; /** * @描述:文章管理 服务类 @@ -62,7 +62,7 @@ public class SysContentServiceImpl extends ServiceImpl page = new Page(reqVO.getPageNum(), reqVO.getPageSize()); - IPage pageList = baseMapper.getPublishedArticles(page,reqVO); + IPage pageList = baseMapper.getPublishedArticles(page, reqVO); return R.success(pageList); } @@ -71,13 +71,23 @@ public class SysContentServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("is_release", Constant.ARTICLE_PUBLISHED); - queryWrapper.eq("template_status",Constant.TEMPLATE_STATUS_ENABLED); + queryWrapper.eq("template_status", Constant.TEMPLATE_STATUS_ENABLED); List sysContentList = mapper.selectList(queryWrapper); return R.success(sysContentList); } + + @Override + public R getTheFullArticleByColumn(String ids) { + return R.success(mapper.useTheColumnToGetTagsForTheFullArticle(ids)); + } + + + + } + diff --git a/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java index c98347a..e99930b 100644 --- a/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java +++ b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java @@ -41,4 +41,12 @@ public class PageContentReqVO extends PageReqVO { @ApiModelProperty(value = "分类id") private Integer classificationId; + + @ApiModelProperty(value = "标签名称") + private List labelName; + + + @ApiModelProperty(value = "召开类型(1.即将召开 2.已经召开)") + private Integer convokeType; + } \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java b/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java index 87483de..1d97458 100644 --- a/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java +++ b/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java @@ -103,4 +103,85 @@ public class PageContentRespVO { @ApiModelProperty(value = "是否禁用(0默认,0启用 1禁用)") private String classificationName; + + @ApiModelProperty(value = "创建人id") + private Integer founderId; + + @ApiModelProperty(value = "编辑人id") + private Integer editorId; + + + @ApiModelProperty(value = "是否在新窗口打开(0:否 1:是)") + private Integer isOpen; + + @ApiModelProperty(value = "是否删除(1未删除;0已删除)") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "站点id") + private Integer siteId; + + @ApiModelProperty(value = "模板状态(0禁用;1启用)") + private Integer templateStatus; + + + @ApiModelProperty(value = "链接类型") + private Integer connectionType; + + @ApiModelProperty(value = "链接地址") + private String linkAddress; + + @ApiModelProperty(value = "站点选择(连接类型为其它站点连接时储存)") + private Integer siteSelection; + + @ApiModelProperty(value = "编辑人") + private String edit; + + @ApiModelProperty(value = "审核人") + private String audit; + + @ApiModelProperty(value = "活动开始时间") + private Date activityStartTime; + + @ApiModelProperty(value = "活动结束时间") + private Date activityEndTime; + + @ApiModelProperty(value = "演讲系列") + private String lectureSeries; + + @ApiModelProperty(value = "线上地点") + private String onlineLocation; + + @ApiModelProperty(value = "线下地点") + private String offlineLocation; + + @ApiModelProperty(value = "主讲人") + private String keynoteSpeaker; + + @ApiModelProperty(value = "活动简介") + private String eventProfile; + + @ApiModelProperty(value = "出版年份") + private String publicationYear; + + @ApiModelProperty(value = "出版类型(前端自定义)") + private Integer publicationTypeId; + + @ApiModelProperty(value = "DOI") + private String doi; + + @ApiModelProperty(value = "引用") + private String quote; + + @ApiModelProperty(value = "主题标签(sys_content_label表外键) 可多选逗号隔开") + private String lableId; + + @ApiModelProperty(value = "所属分类(sys_content_classification表外键)") + private Integer classificationId; + + + @ApiModelProperty(value = "样式id(用于前端区分是会议还是文章跳转界面)") + private Integer listStyleId; + + } \ No newline at end of file