feat:首页修改添加宣传图

new-v20240713
wangxy 1 week ago
parent cf00c8c060
commit 7cf4c63bcd

@ -0,0 +1,73 @@
package com.ruoyi.web.controller.home;
import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.SysColumn;
import com.ruoyi.system.domain.SysColumnVO;
import com.ruoyi.system.service.ISysColumnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* ClassName: ColumnController
* Package: com.ruoyi.web.controller.home
* Description:
*
* @Author wangxy
* @Create 2025/3/27 9:54
* @Version 1.0
*/
@Api("栏目树")
@RestController
@RequestMapping("/columnTree")
public class ColumnTreeController extends BaseController {
//专题活动类型
public static final String SPECIAL_COLUMN_TYPE = "2";
//栏目等级
public static final String COLUMN_GRADE = "2";
public static final String STATUS = "0";
@Autowired
private ISysColumnService columnService;
@ApiOperation("类别树")
@GetMapping("/getTree")
public R<List<SysColumnVO>> getTree(@RequestParam(required = false, defaultValue = "0") String parentId) {
LambdaQueryWrapper<SysColumn> tagWrapper = new LambdaQueryWrapper<>();
tagWrapper.eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE)
.eq(SysColumn::getColumnGrade, COLUMN_GRADE)
.eq(SysColumn::getStatus,STATUS)
.orderByAsc(SysColumn::getOrderNum);
List<SysColumn> datas = columnService.list(tagWrapper);
List<SysColumnVO> tagTreeVOList = new ArrayList<>(Convert.toList(SysColumnVO.class, datas));
tagTreeVOList.forEach(this::buildChildren);
return R.ok(tagTreeVOList);
}
/**
*
*
* @param pNode
*/
private void buildChildren(SysColumnVO pNode) {
// 获取子节点
LambdaQueryWrapper<SysColumn> tagWrapper = new LambdaQueryWrapper<>();
tagWrapper.eq(SysColumn::getParentId, pNode.getColumnId());
List<SysColumn> dataTags = columnService.list(tagWrapper);
List<SysColumnVO> children = Convert.toList(SysColumnVO.class, dataTags);
// 递归获取子节点
children.forEach(this::buildChildren);
pNode.setChildren(children);
}
}

@ -314,6 +314,7 @@ public class ShiroConfig
filterChainDefinitionMap.put("/public_view.html", "anon");
filterChainDefinitionMap.put("/profile/**", "anon");
filterChainDefinitionMap.put("/search", "anon");
filterChainDefinitionMap.put("/columnTree/**", "anon");
// 系统权限列表
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());

@ -0,0 +1,46 @@
package com.ruoyi.system.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* ClassName: SysColumnVO
* Package: com.ruoyi.system.domain
* Description:
*
* @Author wangxy
* @Create 2025/3/27 9:46
* @Version 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysColumnVO implements Serializable {
private static final long serialVersionUID = 1L;
private String columnId;
/** 菜单名称 */
private String columnName;
private String columnCode;
/** 父菜单ID */
private String parentId;
/** 栏目等级 */
private String columnGrade;
private List<SysColumnVO> children ;
}
Loading…
Cancel
Save