wuyouming666
2024-05-16 c249715e750d6f8833e0deb9a6c85580a5ff1747
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/service/impl/DownWorkstationServiceImpl.java
@@ -76,20 +76,29 @@
        List<Map<String, Object>> result = new ArrayList<>();
        for (DownWorkstionAndDownGlassinfo downWorkstionAndDownGlassinfo : workstationList) {
            Map<String, Object> rack = new HashMap<>();
            // 创建子项(item)对象
            Map<String, Object> item = new HashMap<>();
            item.put("height", downWorkstionAndDownGlassinfo.getTotalheight()); // 设置子项高度,根据实际情况设置
            item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth()); // 设置子项宽度,根据实际情况设置
            item.put("fillColor", "yellow"); // 设置子项颜色
            item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId()); // 使用流程卡号作为子项内容
            item.put("height", downWorkstionAndDownGlassinfo.getTotalheight());
            item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth());
            item.put("fillColor", "yellow");
            item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId());
            rack.put("item", item); // 将子项对象放入货架对象中
            // 查询 DownGlassInfo 并添加到 item 中
            MPJQueryWrapper<DownGlassInfo> glassInfoQueryWrapper = new MPJQueryWrapper<>();
            glassInfoQueryWrapper.select("*"); // 查询所有列
            glassInfoQueryWrapper.eq("flow_card_id", downWorkstionAndDownGlassinfo.getFlowCardId());
            List<DownGlassInfo> downGlassInfoList = downGlassInfoMapper.selectList(glassInfoQueryWrapper);
            result.add(rack); // 将货架对象添加到结果列表中
            //log.info("货架对象: {}", rack);
         if (!downGlassInfoList.isEmpty()) {
                item.put("downGlassInfoList", downGlassInfoList);
            }
            rack.put("item", item);
            result.add(rack);
        }
        log.info("result"+(result));
        return result; // 返回最终结果
    }