|
@@ -1,5 +1,6 @@
|
|
|
package cn.cslg.pas.service.impl;
|
|
|
|
|
|
+import cn.cslg.pas.common.JsonPage;
|
|
|
import cn.cslg.pas.common.model.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.dto.EventAddNewDTO;
|
|
|
import cn.cslg.pas.common.model.dto.EventQueryPageDTO;
|
|
@@ -15,6 +16,8 @@ import cn.cslg.pas.service.ProjectService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -105,10 +108,11 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
|
|
|
if (projectId != null) {
|
|
|
queryWrapper.eq(Event::getProjectId, projectId);
|
|
|
}
|
|
|
+
|
|
|
if (current != null && size != null) {
|
|
|
- return Response.success(this.page(new Page<>(current, size), queryWrapper.orderByDesc(Event::getCreateTime)));
|
|
|
+ PageHelper.startPage(current, size);
|
|
|
}
|
|
|
- List<Event> events = eventMapper.selectList(queryWrapper);
|
|
|
+ List<Event> events = eventMapper.selectList(queryWrapper.orderByDesc(Event::getCreateTime));
|
|
|
for (Event event : events) {
|
|
|
String applicationScenario = event.getApplicationScenario();
|
|
|
if (applicationScenario != null && !applicationScenario.equals("")) {
|
|
@@ -116,7 +120,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
|
|
|
event.setApplicationScenarios(applicationScenarios);
|
|
|
}
|
|
|
}
|
|
|
- return Response.success(events);
|
|
|
+ return Response.success(JsonPage.restPage(new PageInfo(events)));
|
|
|
}
|
|
|
|
|
|
|