From 46168fbb7c925b0ec04def176095e967720e684a Mon Sep 17 00:00:00 2001
From: chen.llin <1442464845@qq.comm>
Date: 星期五, 16 一月 2026 15:22:07 +0800
Subject: [PATCH] agv查询修复
---
src/main/java/com/zy/asrs/controller/TaskLogController.java | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/TaskLogController.java b/src/main/java/com/zy/asrs/controller/TaskLogController.java
index d4910b7..440c4ee 100644
--- a/src/main/java/com/zy/asrs/controller/TaskLogController.java
+++ b/src/main/java/com/zy/asrs/controller/TaskLogController.java
@@ -12,6 +12,7 @@
import com.zy.asrs.entity.TaskLog;
import com.zy.asrs.service.TaskLogService;
import com.zy.common.web.BaseController;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -20,6 +21,7 @@
import java.util.List;
import java.util.Map;
+@Slf4j
@RestController
public class TaskLogController extends BaseController {
@@ -40,20 +42,33 @@
@RequestParam(required = false) String orderByType,
@RequestParam(required = false) String condition,
@RequestParam Map<String, Object> param) {
- EntityWrapper<TaskLog> wrapper = new EntityWrapper<>();
- excludeTrash(param);
- convert(param, wrapper);
- allLike(TaskLog.class, param.keySet(), wrapper, condition);
- if (!Cools.isEmpty(orderByField)) {
- wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
+ try {
+ log.info("TaskLog鏌ヨ璇锋眰锛屽弬鏁帮細curr={}, limit={}, param={}", curr, limit, param);
+ EntityWrapper<TaskLog> wrapper = new EntityWrapper<>();
+ excludeTrash(param);
+ convert(param, wrapper);
+ allLike(TaskLog.class, param.keySet(), wrapper, condition);
+ if (!Cools.isEmpty(orderByField)) {
+ wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
+ }
+ wrapper.orderBy("appe_time",false);
+ Page<TaskLog> page = taskLogService.selectPage(new Page<>(curr, limit), wrapper);
+ log.info("TaskLog鏌ヨ鎴愬姛锛岃繑鍥瀧}鏉¤褰�", page.getRecords().size());
+ return R.ok(page);
+ } catch (Exception e) {
+ log.error("TaskLog鏌ヨ澶辫触", e);
+ e.printStackTrace();
+ return R.error("鏌ヨ澶辫触锛�" + e.getMessage());
}
- wrapper.orderBy("appe_time",false);
- return R.ok(taskLogService.selectPage(new Page<>(curr, limit), wrapper));
}
private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper) {
for (Map.Entry<String, Object> entry : map.entrySet()) {
String val = String.valueOf(entry.getValue());
+ // 璺宠繃绌哄�煎拰 "null" 瀛楃涓�
+ if (Cools.isEmpty(val) || "null".equals(val)) {
+ continue;
+ }
if (val.contains(RANGE_TIME_LINK)) {
String[] dates = val.split(RANGE_TIME_LINK);
wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
--
Gitblit v1.9.1