feat:获取专题栏目

new-v20240713
wangxy 7 days ago
parent 8b5068c226
commit ddc0dda586

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

Loading…
Cancel
Save