Commit 037c045c authored by 张森's avatar 张森

分页APIbug修改

parent 91c085b5
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper; import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper; import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskRoleMapper;
import com.yeejoin.amos.fas.business.feign.JcsFeign; import com.yeejoin.amos.fas.business.feign.JcsFeign;
...@@ -22,7 +23,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -22,7 +23,6 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper; import com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper;
...@@ -23,8 +24,6 @@ import org.apache.commons.lang3.StringUtils; ...@@ -23,8 +24,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -80,8 +79,10 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService { ...@@ -80,8 +79,10 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
public Page<EmergencyTaskContent> list(Long obligationId, String planType, CommonPageable pageable) { public Page<EmergencyTaskContent> list(Long obligationId, String planType, CommonPageable pageable) {
int total = emergencyTaskMapper.getEmergencyTaskCount(obligationId, planType); int total = emergencyTaskMapper.getEmergencyTaskCount(obligationId, planType);
List<EmergencyTaskContent> emergencyTaskList = emergencyTaskMapper.getEmergencyTaskList(obligationId, pageable.getOffset(), pageable.getPageSize(), planType); List<EmergencyTaskContent> emergencyTaskList = emergencyTaskMapper.getEmergencyTaskList(obligationId, pageable.getOffset(), pageable.getPageSize(), planType);
Page<EmergencyTaskContent> result = new PageImpl<>(emergencyTaskList, pageable, total); Page<EmergencyTaskContent> emergencyTaskRolePage = new Page<>(pageable.getPageNumber(), pageable.getPageSize());
return result; emergencyTaskRolePage.setRecords(emergencyTaskList);
emergencyTaskRolePage.setTotal(total);
return emergencyTaskRolePage;
} }
......
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo; import com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelation; import com.yeejoin.amos.fas.dao.entity.EmergencyRelation;
import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree; import com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree;
import com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent; import com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent;
import org.springframework.data.domain.Page;
import java.util.List; import java.util.List;
......
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