Commit 079c85f6 authored by nie'hong's avatar nie'hong

修改中移接口,项目被删除后查询的是最新创建的项目

parent 463615b9
......@@ -408,6 +408,13 @@ public class ChinaMobileRestApiController extends BaseController {
@RequiresAuthentication //@RequiresPermissions("exhibition:board:page")
@ApiOperation(value = "总展板列表查询", notes = "总展板列表查询")
public Map<String, Object> getExhibitionBoardPageList(@RequestParam(value = "learningProjectId", required = false) String learningProjectId) {
// 要求如果展板被删除,返回最新创建的展板
LearningProject project = this.learningProjectService.getById(learningProjectId);
if (project == null) {
LambdaQueryWrapper<LearningProject> last = Wrappers.<LearningProject>lambdaQuery().orderByDesc(LearningProject::getCreateTime).last("LIMIT 1");
LearningProject one = this.learningProjectService.getOne(last);
learningProjectId = one.getId();
}
//中移要求,如果翻页参数超出数据总数,返回第一页
Page<ExhibitionBoard> page1 = getPage();
long l = page1.getCurrent() * page1.getSize()-10;
......@@ -415,6 +422,7 @@ public class ChinaMobileRestApiController extends BaseController {
if (l>size){
page1 = new Page<>(1, 10);
}
final IPage<ExhibitionBoard> page = this.learningContentBoardService.getBoardPageByLearningProjectId(page1, learningProjectId, null);
for (ExhibitionBoard exhibitionBoard : page.getRecords()) {
exhibitionBoard.setLearningProjectId(learningProjectId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment