自动化立体仓库 - WMS系统
chen.llin
1 天以前 46168fbb7c925b0ec04def176095e967720e684a
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,6 +42,8 @@
                  @RequestParam(required = false) String orderByType,
                  @RequestParam(required = false) String condition,
                  @RequestParam Map<String, Object> param) {
        try {
            log.info("TaskLog查询请求,参数:curr={}, limit={}, param={}", curr, limit, param);
        EntityWrapper<TaskLog> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
@@ -48,12 +52,23 @@
            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
        }
        wrapper.orderBy("appe_time",false);
        return R.ok(taskLogService.selectPage(new Page<>(curr, limit), wrapper));
            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());
        }
    }
    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]));