1
20 小时以前 e711c834aec2293c53b07efe53e81e3573c289b6
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/BasStationController.java
@@ -10,6 +10,8 @@
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.KeyValVo;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.common.domain.PageResult;
import com.vincent.rsf.server.manager.controller.vo.BasStationOptionVo;
import com.vincent.rsf.server.manager.entity.BasStation;
import com.vincent.rsf.server.manager.enums.LocStsType;
import com.vincent.rsf.server.manager.service.BasStationService;
@@ -19,7 +21,7 @@
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
@@ -59,7 +61,15 @@
    public R pagev22(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<BasStation, BaseParam> pageParam = new PageParam<>(baseParam, BasStation.class);
        return R.ok().add(basStationService.page(pageParam, pageParam.buildWrapper(true)));
        PageParam<BasStation, BaseParam> page = basStationService.page(
                pageParam,
                pageParam.buildWrapper(true).select("id", "station_name", "station_id")
        );
        PageResult<BasStationOptionVo> pageResult = new PageResult<>();
        pageResult
                .setTotal(page.getTotal())
                .setRecords(page.getRecords().stream().map(this::buildOptionVo).collect(Collectors.toList()));
        return R.ok().add(pageResult);
    }
    @PreAuthorize("hasAuthority('manager:basStation:list')")
@@ -189,4 +199,12 @@
        ExcelUtil.build(ExcelUtil.create(basStationService.list(), BasStation.class), response);
    }
    private BasStationOptionVo buildOptionVo(BasStation station) {
        BasStationOptionVo optionVo = new BasStationOptionVo();
        optionVo.setId(station.getId());
        optionVo.setStationName(station.getStationName());
        optionVo.setStationId(station.getStationId());
        return optionVo;
    }
}