From 14d7f0df63340ede75458c0e91b902376ef4dd64 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 20 十一月 2024 11:26:32 +0800 Subject: [PATCH] 1、优化代码;2、修改长级测试中发现的bug;3、通信中间件配置文件配置项修改 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java | 40 +++++++++++++++++++++++----------------- 1 files changed, 23 insertions(+), 17 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java index 8af19e3..41344a3 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java @@ -19,30 +19,25 @@ * 姣忛〉鏄剧ず鐨勮褰曟暟 */ @Schema(description = "姣忛〉璁板綍鏁�") - @Builder.Default - public Integer pageSize = 0 ; + public Integer pageSize ; /** * 璁板綍鎬绘暟 */ @Schema(description = "璁板綍鎬绘暟") - @Builder.Default - public Long itemTotal = 0L; + public Long itemTotal ; /** * 褰撳墠椤� */ @Schema(description = "褰撳墠椤�") - @Builder.Default - public Integer pageCurr = 0; + public Integer pageCurr ; /** * 鎬婚〉鏁� */ @Schema(description = "鎬婚〉鏁�") - @Builder.Default - public Integer pageTotal = 0; + public Integer pageTotal ; @Schema(description = "鏁版嵁") - @Builder.Default - public T content = null; + public T obj; /** * 鏌ヨ寮�濮嬭褰� @@ -62,18 +57,27 @@ public void calculateAndSet(Long itemTotal, Map<String, Object> params) { this.itemTotal = itemTotal ; if(this.itemTotal == null){ - itemTotal = 0L ; + this.itemTotal = 0L ; } - if (pageSize < 1) { - pageSize = 1; + if(this.itemTotal == 0){ + this.pageSize = 10 ; } - pageTotal = (int)Math.ceil((double)itemTotal/pageSize); + if(this.pageSize == null || this.pageSize <= 0){ + /** + * 鏈卞疂姘� 2024-01-30 淇敼 + * 鏈紶鍏ュ垎椤靛弬鏁版椂锛屽彇鍏ㄩ儴璁板綍 + */ + //this.pageSize = 1 ;//渚涗笅闈綔涓洪櫎鏁� + this.pageSize = 10 ;//渚涗笅闈綔涓洪櫎鏁� + } + + pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize); if (pageTotal == 0) { pageTotal = 1; } - if (pageCurr < 1) { + if (pageCurr == null || pageCurr < 1) { pageCurr = 1; } if (pageCurr > pageTotal) { @@ -84,8 +88,10 @@ this.queryStart = (this.pageCurr - 1) * this.pageSize ; this.queryCount = this.pageSize ; - params.put("queryStart", this.queryStart) ; - params.put("queryCount", this.queryCount) ; + if(params != null){ + params.put("start", this.queryStart) ; + params.put("count", this.queryCount) ; + } } } -- Gitblit v1.8.0