From fbf235d746ca7bae6b829944974623dddb4dd869 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Sun, 29 Mar 2026 21:27:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E8=B5=84=E6=BA=90=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E4=BE=9B=E8=AF=95=E5=93=81=E5=88=97=E8=A1=A8]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/form/gsp/GspSearchListForm.java | 21 +++++++++++++++++++++ .../hxhq/business/service/impl/GspServiceImpl.java | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java index de82d29..c24646f 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java @@ -66,6 +66,11 @@ public class GspSearchListForm { /** 出库日期结束 */ private String endDateCk; + /** 排序字段 */ + private String sortProp; + + /** 排序方向 ascending、descending */ + private String order; public Long getMdId() { @@ -211,4 +216,20 @@ public class GspSearchListForm { public void setJlzt(Integer jlzt) { this.jlzt = jlzt; } + + public String getSortProp() { + return sortProp; + } + + public void setSortProp(String sortProp) { + this.sortProp = sortProp; + } + + public String getOrder() { + return order; + } + + public void setOrder(String order) { + this.order = order; + } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java index 525bac5..558b2e2 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java @@ -307,6 +307,15 @@ public class GspServiceImpl extends ServiceImpl implements IGspS if(form.getArchive() != null && form.getArchive() == DaztEnum.ygd.getValue()) { queryWrapper.in("zjzt", ZjztEnum.dgd.getValue(), ZjztEnum.gd.getValue(), ZjztEnum.djd.getValue()); } + if(StringUtils.isEmpty(form.getSortProp()) || StringUtils.isEmpty(form.getOrder())) { + queryWrapper.orderByDesc("id"); + } else { + if(StringUtils.equals(form.getOrder(), "ascending")) { + queryWrapper.orderByAsc(form.getSortProp()); + } else { + queryWrapper.orderByDesc(form.getSortProp()); + } + } return this.list(queryWrapper); }