|
|
|
@ -0,0 +1,48 @@ |
|
|
|
package com.gaotao.modules.base.service.Impl; |
|
|
|
|
|
|
|
import com.gaotao.common.utils.DateUtil; |
|
|
|
import com.gaotao.modules.api.entity.IfsCallErrorLogData; |
|
|
|
import com.gaotao.modules.base.mapper.BoardMapper; |
|
|
|
import com.gaotao.modules.base.service.BoardService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class BoardServiceImpl implements BoardService { |
|
|
|
@Autowired |
|
|
|
private BoardMapper boardMapper; |
|
|
|
@Override |
|
|
|
public Map<String, Object> ifsCallErrorLogBoard(int pageIndex){ |
|
|
|
int kanbannum=18; |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
calendar.add(Calendar.HOUR_OF_DAY, -24); // 减去24小时 |
|
|
|
Date date24HoursAgo = calendar.getTime(); |
|
|
|
List<IfsCallErrorLogData> list =boardMapper.ifsCallErrorLogBoard("55",date24HoursAgo); |
|
|
|
double number=list.size(); |
|
|
|
int maxPage=(int)Math.ceil(number/kanbannum); |
|
|
|
if(pageIndex>maxPage){ |
|
|
|
pageIndex=1; |
|
|
|
} |
|
|
|
List<IfsCallErrorLogData> result =new ArrayList<>(); |
|
|
|
if(pageIndex<maxPage){ |
|
|
|
for(int i=0;i<kanbannum;i++){ |
|
|
|
result.add(list.get((pageIndex-1)*kanbannum+i)); |
|
|
|
} |
|
|
|
}else { |
|
|
|
for(int i=0;(pageIndex-1)*kanbannum+i<number;i++){ |
|
|
|
result.add(list.get((pageIndex-1)*kanbannum+i)); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("maxPage", maxPage); |
|
|
|
map.put("rows", result); |
|
|
|
map.put("total",result.size()); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
} |