Commit 31b2cf2a by 周海峰

优化

parent db76d466
......@@ -94,16 +94,15 @@ public class ExternalController {
public ResultJson queryActivitiList(NoticeManageActivitiDTO noticeManageActivitiDTO, @PathVariable String userid, HttpServletRequest request){
String token = request.getHeader("Auth3");
String url = SpringUtil.getBean(PlatformUrlManager.class).getPlatformURI(PlatformUrlManager.API_ACTIVITI_URL);
String result = null;
try {
result = this.doPost(url, noticeManageActivitiDTO, token);
} catch (Exception e) {
e.printStackTrace();
}
return ResultJson.ok(JSONObject.parseObject(result));
}
@GetMapping("/law/list/{userid}")
public ResultJson lawlisttoindex(LawPolicylistDTO lawPolicylistDTO, @PathVariable String userid, HttpServletRequest request){
String token = request.getHeader(tokenHeader);
......@@ -169,26 +168,21 @@ public class ExternalController {
public ResultJson queryCommentsPageList(@PathVariable String noticeId,NoticeManageActivitiDTO noticeManageActivitiDTO, int pageIndex, int pageSize,@PathVariable String userid, HttpServletRequest request){
int p= Integer.parseInt(noticeManageActivitiDTO.getPageIndex());
int b= Integer.parseInt(noticeManageActivitiDTO.getPageSize());
noticeManageActivitiDTO.setPageSize(String.valueOf(b));
noticeManageActivitiDTO.setPageIndex(String.valueOf((p-1)*b));
String url = SpringUtil.getBean(PlatformUrlManager.class).getPlatformURI(PlatformUrlManager.API_COMMENTS_PAGE_URL);
String token = request.getHeader("Auth3");
String result = null;
try {
result = this.doPost(url+"/"+noticeId, noticeManageActivitiDTO, token);
log.info("调用公告列表接口返回结果为:"+result+" pageSize="+noticeManageActivitiDTO.getPageSize()+" --- "+noticeManageActivitiDTO.getPageIndex());
JSONObject json = JSONUtil.getJSONFromString(result);
int resultCode = json.getIntValue("resultCode");
String resultMsg = json.getString("resultMs");
int dataCount = json.getIntValue("dataCount");
List<CommentsDTO> list = new ArrayList<CommentsDTO>();
if (resultCode==1){
JSONArray jsonArray =json.getJSONArray("obj");
if (jsonArray!=null&&jsonArray.size()>0){
jsonArray.stream().forEach(jsons->{
JSONObject jsonObject = (JSONObject) jsons;
CommentsDTO commentsDTO = new CommentsDTO();
commentsDTO.setId(jsonObject.getString("id"));
......@@ -219,7 +213,7 @@ public class ExternalController {
});
}
}
Pagination pagination = new Pagination(list,new Long(dataCount),pageSize,pageIndex);
Pagination pagination = new Pagination(list, (long) dataCount,b,p);
return ResultJson.ok(pagination);
} catch (Exception e) {
e.printStackTrace();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论