|
|
|
@ -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
|
|
|
|
@ -98,18 +99,25 @@ public class ColumnTreeController extends BaseController {
|
|
|
|
|
@GetMapping("/getSpecial")
|
|
|
|
|
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<>();
|
|
|
|
|
List<SysSpecialVo> sysSpecialVos = new ArrayList<>();
|
|
|
|
|
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->{
|
|
|
|
|
SysSpecialVo sysSpecialVo = new SysSpecialVo();
|
|
|
|
|
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());
|
|
|
|
|
SysSpecial sysSpecial = new SysSpecial();
|
|
|
|
|