From 038562f5e4e1e6b38736240cc8edb95073ad6431 Mon Sep 17 00:00:00 2001 From: renzexin Date: Fri, 23 Aug 2024 16:13:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=95=86=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/terminal/query/StoreQuery.java | 2 +- .../terminal/controller/StoreController.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java index c439553..8ed4c81 100644 --- a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java +++ b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java @@ -116,7 +116,7 @@ public class StoreQuery extends CommonParam { */ @Condition(name = "create_time", type = Condition.ConditionType.between, tableName = "s") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") - private List createTime; + private List createTime; /** * 创建时间 diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java index 1ba09d4..8627772 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java @@ -19,6 +19,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.validation.constraints.NotNull; +import java.util.List; /** * 商户信息表(st_store)表控制层 @@ -47,8 +48,19 @@ public class StoreController { @GetMapping("/page") @RequiresPermissions("ins:store:page") public AjaxResult pageList(@Validated StoreQuery query) { + List createTimes = query.getCreateTime(); + query.setCreateTime(extendTimeRange(createTimes, " 00:00:00", " 23:59:59")); return AjaxResult.success(storeService.pageList(query)); } + private List extendTimeRange(List timeList, String prefix, String suffix) { + if (timeList != null && timeList.size() >= 2) { + String startTime = timeList.get(0) + prefix; + String endTime = timeList.get(1) + suffix; + timeList.set(0, startTime); + timeList.set(1, endTime); + } + return timeList; + } /** * 修改商户