wuyouming666
2024-07-10 867c818b7660373ab7ca410a923c47e4b6602e2e
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; // 返回最终结果
    }
@@ -127,10 +136,11 @@
    @Override
    public int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId) {
    public int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId,int artificialnumber) {
        UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>();
        updateWrapper.set("total_quantity", glassInfoCount)
                .set("flow_card_id", flowCardId)
                .set("artificial_number", artificialnumber)
                .eq("workstation_id", workstationId);
        return baseMapper.update(new DownWorkstation(), updateWrapper);