Merge remote-tracking branch 'origin/master'

master
cheney 2 years ago
commit c1bc210339
  1. 101
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  2. 6
      src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java
  3. 17
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  4. 27
      src/main/java/com/huoran/iasf/controller/SysTemplateController.java
  5. 5
      src/main/java/com/huoran/iasf/entity/SysContent.java
  6. 4
      src/main/java/com/huoran/iasf/entity/SysContentClassification.java
  7. 5
      src/main/java/com/huoran/iasf/entity/SysTemplateStyle.java
  8. 39
      src/main/java/com/huoran/iasf/entity/SysTemplateStyleConfiguration.java
  9. 3
      src/main/java/com/huoran/iasf/mapper/SysColumnMapper.java
  10. 5
      src/main/java/com/huoran/iasf/mapper/SysContentFileMapper.java
  11. 9
      src/main/java/com/huoran/iasf/mapper/SysContentMapper.java
  12. 20
      src/main/java/com/huoran/iasf/mapper/SysTemplateStyleConfigurationMapper.java
  13. 63
      src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml
  14. 9
      src/main/java/com/huoran/iasf/mapper/xml/SysContentFileMapper.xml
  15. 120
      src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml
  16. 13
      src/main/java/com/huoran/iasf/mapper/xml/SysTemplateStyleConfigurationMapper.xml
  17. 7
      src/main/java/com/huoran/iasf/service/SysColumnService.java
  18. 3
      src/main/java/com/huoran/iasf/service/SysContentFileService.java
  19. 2
      src/main/java/com/huoran/iasf/service/SysContentService.java
  20. 19
      src/main/java/com/huoran/iasf/service/SysTemplateStyleConfigurationService.java
  21. 2
      src/main/java/com/huoran/iasf/service/SysTemplateStyleService.java
  22. 5
      src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java
  23. 5
      src/main/java/com/huoran/iasf/service/impl/SysContentFileServiceImpl.java
  24. 20
      src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java
  25. 29
      src/main/java/com/huoran/iasf/service/impl/SysTemplateStyleConfigurationServiceImpl.java
  26. 14
      src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java
  27. 89
      src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java
  28. 2
      src/test/java/com/company/project/CodeGenerator.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,11 +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;
/**
@ -45,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)
@ -63,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);
}
@ -70,6 +86,10 @@ public class SysColumnController {
@PostMapping("/save")
@ApiOperation(value = "新增", response = SysColumn.class)
public R save(@RequestBody @Valid SysColumn sysColumn) {
QueryWrapper<SysColumn> queryWrapper = new QueryWrapper<SysColumn>();
queryWrapper.eq("father_id", sysColumn.getFatherId());
Integer count = service.count(queryWrapper);
sysColumn.setSort(count + 1);
boolean addState = service.save(sysColumn);
return addState ? R.success(sysColumn.getId()) : R.fail("新增失败");
}
@ -119,21 +139,76 @@ public class SysColumnController {
SysColumn sysColumn = new SysColumn();
BeanUtils.copyProperties(sort, sysColumn);
service.updateById(sysColumn);
//依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id
/*QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_id", sysColumn.getId());
List<SysContent> contentList = contentService.list(queryWrapper);
if (contentList.size() > 0) {
for (SysContent content : contentList) {
UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("column_id", sysColumn.getId());
contentService.update(content, updateWrapper);
}
}*/
return R.success();
}
return R.success();
@ApiOperation("获取一级下的子级栏目(包含自己)")
@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<Integer> idList = new ArrayList<>();
//2 向idList集合设置删除菜单id
this.selectCategoryChildById(id + "", idList);//找到当前菜单的子菜单 把结果id封装到idlist里面去
//把当前id封装到list里面
idList.add(id);//现在把当前id封装进去 之前都是子菜单的id
String str = "";
for (Integer idstr : idList) {
str += idstr + ",";
}
String ids = str.substring(0, str.length() - 1);
return ids;
}
public void selectCategoryChildById(String id, List<Integer> idList) {
//查询菜单里面子菜单id
QueryWrapper<SysColumn> wrapper = new QueryWrapper<SysColumn>();
wrapper.eq("father_id", id);
wrapper.eq("deleted", Constant.DATA_NOT_DELETED);
wrapper.select("id");//我们只想查询id 所以只需要查询指定列的值
List<SysColumn> childIdList = service.list(wrapper);//当前菜单的所有子菜单
//把childIdList里面菜单id值获取出来,封装idList里面,做递归查询
childIdList.stream().forEach(item -> {//遍历集合得到每一个对象item
//封装idList里面
idList.add(item.getId());
//递归查询
this.selectCategoryChildById(item.getId() + "", idList);
});
}
@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<Integer> idList = new ArrayList<>();
//2 向idList集合设置删除菜单id
this.selectCategoryChildById(id + "", idList);//找到当前菜单的子菜单 把结果id封装到idlist里面去
//把当前id封装到list里面
idList.add(id);//现在把当前id封装进去 之前都是子菜单的id
return R.success(idList);
}
}

@ -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<SysContentClassification> list = service.list(new QueryWrapper<SysContentClassification>().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<SysContentClassification> list = service.list(new QueryWrapper<SysContentClassification>()
.eq("site_id", siteId).eq("template_id",templateId));
return R.success(list);
}

@ -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,9 +56,6 @@ public class SysContentController {
}
@PostMapping("/findById")
@ApiOperation(value = "查询详情", response = SysContent.class)
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {
@ -63,7 +65,8 @@ public class SysContentController {
if (sysColumn.getColumnName() != null) {
sysContent.setColumnName(sysColumn.getColumnName());
}
List<SysContentFile> 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<Integer> ids) {
@ -123,6 +125,7 @@ public class SysContentController {
/**
* 获取栏目下的文章
*
* @param pageReq
* @return
*/
@ -137,11 +140,9 @@ public class SysContentController {
}
@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) {
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<SysContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("is_disable", isDisable);
updateWrapper.eq("id", id);

@ -3,6 +3,8 @@ package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.Constant;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.huoran.iasf.entity.SysTemplateStyleConfiguration;
import com.huoran.iasf.service.SysTemplateStyleConfigurationService;
import com.huoran.iasf.service.SysTemplateStyleService;
import io.swagger.annotations.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -41,7 +43,8 @@ public class SysTemplateController {
@Autowired
public SysTemplateStyleService styleService;
@Autowired
public SysTemplateStyleConfigurationService templateStyleConfigurationService;
@PostMapping("/listOfColumnTemplates")
@ApiOperation(value = "获取文章模板列表、详情样式", response = SysTemplate.class)
@ -54,7 +57,7 @@ public class SysTemplateController {
@PostMapping("/longPageListStyle")
@ApiOperation(value = "长页列表样式", response = SysTemplate.class)
public R longPageListStyle() {
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("template_id",9));
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("is_long_page", 1));
return R.success(list);
}
@ -62,16 +65,19 @@ public class SysTemplateController {
@ApiOperation(value = "根据模板id获取样式", response = SysTemplateStyle.class)
public R theTemplateIdGetsTheStyle(@ApiParam(name = "templateId", value = "模板id", required = true) @RequestParam Integer templateId) {
QueryWrapper<SysTemplateStyle> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("template_id",templateId);
/*QueryWrapper<SysTemplateStyle> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", Constant.LIST_TEMPLATE_TYPES);
queryWrapper.eq("is_long_page", 0);
List<SysTemplateStyle> listingTemplateTypes = styleService.list(queryWrapper);
QueryWrapper<SysTemplateStyle> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("template_id",templateId);
queryWrapper1.eq("type", Constant.DETAILS_TEMPLATE_TYPE);
List<SysTemplateStyle> detailsTypeOfTheTemplate = styleService.list(queryWrapper1);
List<SysTemplateStyle> detailsTypeOfTheTemplate = styleService.list(queryWrapper1);*/
List<SysTemplateStyle> listingTemplateTypes = templateStyleConfigurationService.getsTheStyleUnderTheTemplate(templateId, 0);
List<SysTemplateStyle> detailsTypeOfTheTemplate = templateStyleConfigurationService.getsTheStyleUnderTheTemplate(templateId, 1);
Map<String, Object> map = new HashMap<>();
@ -81,9 +87,6 @@ public class SysTemplateController {
}
@PostMapping("/fullDetailsTemplateStyle")
@ApiOperation(value = "全部详情模板样式", response = SysTemplateStyle.class)
public R fullDetailsTemplateStyle() {
@ -93,5 +96,13 @@ public class SysTemplateController {
List<SysTemplateStyle> listingTemplateTypes = styleService.list(queryWrapper);
return R.success(listingTemplateTypes);
}
@PostMapping("/individualTemplateDetailsStyle")
@ApiOperation(value = "独立模板详情样式", response = SysTemplate.class)
public R individualTemplateDetailsStyle() {
List<SysTemplateStyle> list = styleService.list(new QueryWrapper<SysTemplateStyle>().eq("type", 1).eq("is_long_page", 0));
return R.success(list);
}
}

@ -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<SysContentFile> fileList;
}

@ -53,5 +53,9 @@ public class SysContentClassification implements Serializable {
@NotNull(message = "站点id不能为空!")
private Integer siteId;
@ApiModelProperty(value = "模板id(用于区分哪个模板下的分类)")
@NotNull(message = "模板id不能为空!")
private Integer templateId;
}

@ -35,13 +35,12 @@ public class SysTemplateStyle implements Serializable {
@ApiModelProperty(value = "样式名称")
private String style;
@ApiModelProperty(value = "模板id")
private Integer templateId;
@ApiModelProperty(value = "跳转路径")
private String path;
@ApiModelProperty(value = "是否为长页")
private Integer isLongPage;
}

@ -0,0 +1,39 @@
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;
import lombok.EqualsAndHashCode;
/**
* <p>
* 栏目样式列表样式详情样式配置表
* </p>
*
* @author cheney
* @since 2022-11-24
*/
@Data
@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 = "模板id")
private Integer templateId;
@ApiModelProperty(value = "样式id")
private Integer styleId;
}

@ -2,6 +2,7 @@ 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.SysColumn;
import com.huoran.iasf.vo.FatherContentRespVO;
import com.huoran.iasf.vo.req.LongPageColumnReqVO;
@ -32,4 +33,6 @@ public interface SysColumnMapper extends BaseMapper<SysColumn> {
//依据子级查询父级
List<FatherContentRespVO> getParentInformationBasedOnChild(@Param("id")Integer id);
List<SysColumn> getsTheSubColumn(@Param("parentId")Integer parentId ,@Param("ids")String ids);
}

@ -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<SysContentFile> {
List<SysContentFile> getFileByContentId(@Param("contentId") Integer contentId);
}

@ -2,13 +2,18 @@ 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;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @描述文章管理 Mapper 接口
* @作者: Rong
@ -17,4 +22,8 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysContentMapper extends BaseMapper<SysContent> {
IPage<PageContentRespVO> articlePaginationList(Page<PageContentRespVO> page, @Param("req") PageContentReqVO req);
IPage<PageContentRespVO> getPublishedArticles(Page<PageContentRespVO> page, @Param("req") PageContentReqVO req);
List<SysContentClassification> useTheColumnToGetTagsForTheFullArticle(String ids);
}

@ -0,0 +1,20 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.huoran.iasf.entity.SysTemplateStyleConfiguration;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 栏目样式列表样式详情样式配置表 Mapper 接口
* </p>
*
* @author cheney
* @since 2022-11-24
*/
public interface SysTemplateStyleConfigurationMapper extends BaseMapper<SysTemplateStyleConfiguration> {
List<SysTemplateStyle> getTheStyleUnderTheTemplate(@Param("templateId") Integer templateId,@Param("type") Integer type);
}

@ -49,9 +49,7 @@
<if test="vo.isSort== 1">
ORDER BY
s.father_id,
s.sort ASC,
s.create_time desc
s.sort ASC
</if>
<if test="vo.isSort== 0">
ORDER BY
@ -78,16 +76,13 @@
T2.father_id,
T2.level,
T2.sort
FROM (
SELECT @r AS _id,
FROM (SELECT @r AS _id,
( SELECT @r := father_id FROM sys_column WHERE id = _id ) AS parent_id,
@l := @l + 1 AS lvl
FROM
( SELECT @r := #{id}, @l := 0 ) vars,
sys_column h
( SELECT @r := #{id}, @l := 0 ) vars, sys_column h
WHERE
@r != 0
) T1
@r != 0) T1
JOIN sys_column T2 ON T1._id = T2.id
WHERE
deleted = 1
@ -102,7 +97,36 @@
( SELECT u.username FROM sys_user u WHERE u.id = s.editor_id ) AS editorUser,
( SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id ) AS templateName,
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id ) AS listStyle,
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id ) AS detailStyle
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id ) AS detailStyle,
( SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id ) AS path
FROM
sys_column s
WHERE deleted = 1 and site_id = #{vo.siteId}
and menu_visible = 0
<if test="vo.columnName != '' and vo.columnName!= null">
and column_name LIKE CONCAT('%',#{vo.columnName},'%')
</if>
<if test="vo.isSort== 1">
ORDER BY
s.sort ASC
</if>
<if test="vo.isSort== 0">
ORDER BY
s.create_time asc
</if>
</select>
<!--<select id="filterMenuVisible" resultType="com.huoran.iasf.entity.SysColumn">
SELECT
*,
( SELECT u.username FROM sys_user u WHERE u.id = s.founder_id ) AS creteUser,
( SELECT u.username FROM sys_user u WHERE u.id = s.editor_id ) AS editorUser,
( SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id ) AS templateName,
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id ) AS listStyle,
( SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id ) AS detailStyle,
( SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id ) AS path
FROM
sys_column s
WHERE deleted = 1 and site_id = #{vo.siteId}
@ -121,6 +145,25 @@
ORDER BY
s.create_time asc
</if>
</select>-->
<select id="getsTheSubColumn" resultType="com.huoran.iasf.entity.SysColumn">
SELECT *,
(SELECT u.username FROM sys_user u WHERE u.id = s.founder_id) AS creteUser,
(SELECT u.username FROM sys_user u WHERE u.id = s.editor_id) AS editorUser,
(SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id) AS templateName,
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS listStyle,
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id) AS detailStyle,
(SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS path
FROM sys_column s
WHERE deleted = 1
AND site_id = 1
<if test="ids != '' and ids!= null">
and FIND_IN_SET(s.id, #{ids})
</if>
ORDER BY
s.create_time asc
</select>
</mapper>

@ -16,5 +16,14 @@
<result column="create_time" property="createTime"/>
<result column="deleted" property="deleted"/>
</resultMap>
<select id="getFileByContentId" resultType="com.huoran.iasf.entity.SysContentFile">
SELECT
*
FROM
sys_content_file
WHERE
deleted = 1
AND content_id = #{contentId}
</select>
</mapper>

@ -1,50 +1,6 @@
<?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.huoran.iasf.mapper.SysContentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.huoran.iasf.entity.SysContent">
<id column="id" property="id"/>
<result column="title" property="title"/>
<result column="column_id" property="columnId"/>
<result column="title_img" property="titleImg"/>
<result column="banner_img" property="bannerImg"/>
<result column="source" property="source"/>
<result column="release_time" property="releaseTime"/>
<result column="summary" property="summary"/>
<result column="article_template" property="articleTemplate"/>
<result column="main_body" property="mainBody"/>
<result column="author" property="author"/>
<result column="is_release" property="isRelease"/>
<result column="founder_id" property="founderId"/>
<result column="editor_id" property="editorId"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="total_browsing" property="totalBrowsing"/>
<result column="connection_type" property="connectionType"/>
<result column="link_address" property="linkAddress"/>
<result column="site_selection" property="siteSelection"/>
<result column="is_open" property="isOpen"/>
<result column="deleted" property="deleted"/>
<result column="site_id" property="siteId"/>
<result column="template_status" property="templateStatus"/>
<result column="edit" property="edit"/>
<result column="audit" property="audit"/>
<result column="activity_start_time" property="activityStartTime"/>
<result column="activity_end_time" property="activityEndTime"/>
<result column="lecture_series" property="lectureSeries"/>
<result column="online_location" property="onlineLocation"/>
<result column="offline_location" property="offlineLocation"/>
<result column="keynote_speaker" property="keynoteSpeaker"/>
<result column="event_profile" property="eventProfile"/>
<result column="publication_year" property="publicationYear"/>
<result column="publication_type_id" property="publicationTypeId"/>
<result column="doi" property="doi"/>
<result column="quote" property="quote"/>
<result column="lable_id" property="lableId"/>
<result column="classification_id" property="classificationId"/>
</resultMap>
<select id="articlePaginationList" resultType="com.huoran.iasf.vo.resp.PageContentRespVO">
SELECT c.*,
(SELECT sys_column.column_name FROM sys_column WHERE sys_column.id = c.column_id) AS columnName,
@ -84,4 +40,80 @@
</select>
<select id="getPublishedArticles" resultType="com.huoran.iasf.vo.resp.PageContentRespVO">
SELECT
t.*,(SELECT cl.list_style_id from sys_column cl WHERE cl.id = t.column_id) as listStyleId
FROM
(
SELECT
s.*,
( SELECT GROUP_CONCAT( label_name ) FROM sys_content_label l WHERE deleted = 1 AND FIND_IN_SET( l.id, s.lable_id
) ) AS labelName,
( SELECT c.classification_name FROM sys_content_classification c WHERE deleted = 1 AND s.classification_id =
c.id ) AS classificationName
FROM
sys_content s
WHERE
is_disable = 0
AND is_release = 1
) t
WHERE
t.site_id = 1
<if test="req.labelName != null and req.labelName.size() > 0 ">
and
<foreach collection="req.labelName" item="item" index="index" open="(" separator="or" close=")">
t.labelName LIKE CONCAT('%',#{item},'%')
</foreach>
</if>
<if test="req.classificationId != null">
AND t.classification_id = #{req.classificationId}
</if>
<if test="req.title != null and req.title != ''">
AND title LIKE
CONCAT('%',#{req.title},'%')
</if>
<if test="req.columnIds != null and req.columnIds.size() > 0 ">
and t.column_id in
<foreach item="item" index="index" collection="req.columnIds"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="req.convokeType == 2">
and unix_timestamp(activity_start_time) <![CDATA[ >= ]]> unix_timestamp(NOW())
</if>
<if test="req.convokeType == 1">
and unix_timestamp(activity_start_time) <![CDATA[ <= ]]> unix_timestamp(NOW())
</if>
ORDER BY
t.create_time DESC
</select>
<select id="useTheColumnToGetTagsForTheFullArticle" resultType="com.huoran.iasf.entity.SysContentClassification">
SELECT *
FROM sys_content_classification c
WHERE c.deleted = 1
AND FIND_IN_SET(
c.id,
(SELECT GROUP_CONCAT(s.classification_id)
FROM sys_content s
INNER JOIN sys_content_classification c ON c.id = s.classification_id
WHERE s.deleted = 1
AND c.deleted = 1
AND FIND_IN_SET(s.column_id, #{ids}))
)
</select>
</mapper>

@ -0,0 +1,13 @@
<?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.huoran.iasf.mapper.SysTemplateStyleConfigurationMapper">
<select id="getTheStyleUnderTheTemplate" resultType="com.huoran.iasf.entity.SysTemplateStyle">
SELECT s.*
FROM sys_template_style_configuration c
inner join sys_template t on c.template_id = t.id
inner join sys_template_style s on s.id = c.style_id
WHERE c.template_id = #{templateId}
and s.type = #{type}
</select>
</mapper>

@ -29,4 +29,11 @@ public interface SysColumnService extends IService<SysColumn> {
//长页栏目列表
R longPageColumnList(LongPageColumnReqVO reqVO);
R getsTheSubColumn(Integer parentId,String ids);
}

@ -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<SysContentFile> {
List<SysContentFile> getFileByContentId(Integer contentId);
}

@ -22,4 +22,6 @@ public interface SysContentService extends IService<SysContent> {
//查询已发布的、启用了的文章列表
R publishedEnabledArticles();
R getTheFullArticleByColumn(String ids);
}

@ -0,0 +1,19 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.huoran.iasf.entity.SysTemplateStyleConfiguration;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 栏目样式列表样式详情样式配置表 服务类
* </p>
*
* @author cheney
* @since 2022-11-24
*/
public interface SysTemplateStyleConfigurationService extends IService<SysTemplateStyleConfiguration> {
List<SysTemplateStyle> getsTheStyleUnderTheTemplate(Integer templateId,Integer type);
}

@ -3,6 +3,8 @@ package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类

@ -133,6 +133,11 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
return R.success(pageList);
}
@Override
public R getsTheSubColumn(Integer parentId,String ids) {
return R.success(baseMapper.getsTheSubColumn(parentId,ids));
}
public static List<SysColumn> getChildren(Integer id, List<SysColumn> allDept) {
//存放子节点

@ -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<SysContentFileMapper,
@Autowired
private SysContentFileMapper mapper;
@Override
public List<SysContentFile> getFileByContentId(Integer contentId) {
return baseMapper.getFileByContentId(contentId);
}
}

@ -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.*;
/**
* @描述文章管理 服务类
@ -58,11 +58,11 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
@Override
public R newlyPublishedArticles(PageContentReqVO reqVO) {
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
/* QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("site_id", reqVO.getSiteId());
queryWrapper.eq("is_release", Constant.ARTICLE_PUBLISHED).orderByDesc("create_time");
Page<SysContent> page = new Page<SysContent>(reqVO.getPageNum(), reqVO.getPageSize());
IPage<SysContent> pageList = baseMapper.selectPage(page, queryWrapper);
queryWrapper.eq("is_release", Constant.ARTICLE_PUBLISHED).orderByDesc("create_time");*/
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize());
IPage<PageContentRespVO> pageList = baseMapper.getPublishedArticles(page, reqVO);
return R.success(pageList);
}
@ -77,7 +77,17 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
return R.success(sysContentList);
}
@Override
public R getTheFullArticleByColumn(String ids) {
return R.success(mapper.useTheColumnToGetTagsForTheFullArticle(ids));
}
}

@ -0,0 +1,29 @@
package com.huoran.iasf.service.impl;
import com.huoran.iasf.entity.SysTemplateStyle;
import com.huoran.iasf.entity.SysTemplateStyleConfiguration;
import com.huoran.iasf.mapper.SysTemplateStyleConfigurationMapper;
import com.huoran.iasf.service.SysTemplateStyleConfigurationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 栏目样式列表样式详情样式配置表 服务实现类
* </p>
*
* @author cheney
* @since 2022-11-24
*/
@Service
public class SysTemplateStyleConfigurationServiceImpl extends ServiceImpl<SysTemplateStyleConfigurationMapper, SysTemplateStyleConfiguration> implements SysTemplateStyleConfigurationService {
@Override
public List<SysTemplateStyle> getsTheStyleUnderTheTemplate(Integer templateId, Integer type) {
return baseMapper.getTheStyleUnderTheTemplate(templateId, type);
}
}

@ -34,5 +34,19 @@ public class PageContentReqVO extends PageReqVO {
@NotNull(message = "站点id不能为空!")
private Integer siteId;
@ApiModelProperty(value = "标签id(逗号隔开)")
private String lableId;
@ApiModelProperty(value = "分类id")
private Integer classificationId;
@ApiModelProperty(value = "标签名称")
private List<String> labelName;
@ApiModelProperty(value = "召开类型(1.即将召开 2.已经召开)")
private Integer convokeType;
}

@ -95,4 +95,93 @@ public class PageContentRespVO {
@ApiModelProperty(value = "是否禁用(0默认,0启用 1禁用)")
private Integer isDisable;
@ApiModelProperty(value = "是否禁用(0默认,0启用 1禁用)")
private String labelName;
@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;
}

@ -61,7 +61,7 @@ public class CodeGenerator {
// 5、策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setInclude("sys_template_style");
strategy.setInclude("sys_template_style_configuration");
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
// strategy.setTablePrefix("sys_"); //生成实体时去掉表前缀

Loading…
Cancel
Save