feat:获取专题栏目

new-v20240713
wangxy 1 week ago
parent 8b5068c226
commit ddc0dda586

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* ClassName: ColumnController * ClassName: ColumnController
@ -99,16 +100,23 @@ public class ColumnTreeController extends BaseController {
public R<PageInfo<SysSpecialVo>> getSpecial(@RequestParam(required = false) String id, public R<PageInfo<SysSpecialVo>> getSpecial(@RequestParam(required = false) String id,
@RequestParam(required = false) String columnId) { @RequestParam(required = false) String columnId) {
List<SysSpecialVo> sysSpecialVos = new ArrayList<>(); List<SysSpecialVo> sysSpecialVos = new ArrayList<>();
LambdaQueryWrapper<SysColumn> queryWrapper= new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysColumn> columnQueryWrapper = new LambdaQueryWrapper<>();
columnQueryWrapper.eq(SysColumn::getStatus, STATUS);
if(StringUtils.isNotEmpty(columnId)){ if(StringUtils.isNotEmpty(columnId)){
queryWrapper.eq(SysColumn::getColumnId, columnId); columnQueryWrapper.eq(SysColumn::getColumnId, columnId);
}else{ }else{
queryWrapper.eq(SysColumn::getParentId, id); columnQueryWrapper.eq(SysColumn::getParentId, id);
} }
queryWrapper.eq(SysColumn::getStatus,STATUS); columnQueryWrapper.orderByAsc(SysColumn::getOrderNum);
queryWrapper.orderByAsc(SysColumn::getOrderNum); List<SysColumn> columns = columnService.list(columnQueryWrapper);
List<SysColumn> specialColumns = columnService.list(queryWrapper); if (columns.isEmpty() && StringUtils.isEmpty(columnId)) {
specialColumns.forEach(column->{ columnQueryWrapper.clear();
columnQueryWrapper.eq(SysColumn::getColumnId, id)
.eq(SysColumn::getStatus, STATUS)
.orderByAsc(SysColumn::getOrderNum);
columns = columnService.list(columnQueryWrapper);
}
columns.forEach(column -> {
SysSpecialVo sysSpecialVo = new SysSpecialVo(); SysSpecialVo sysSpecialVo = new SysSpecialVo();
sysSpecialVo.setColumnId(column.getColumnId()); sysSpecialVo.setColumnId(column.getColumnId());
sysSpecialVo.setColumnName(column.getColumnName()); sysSpecialVo.setColumnName(column.getColumnName());

Loading…
Cancel
Save