admin
2024-10-20 537bfb7e43c78d5b3b98ba8a135b638f0461ea60
jcdm-main/src/main/java/com/jcdm/main/bigScreen/controller/BigScreenController.java
@@ -29,7 +29,8 @@
     * **/
    @GetMapping("/getOrderInformation")
    public AjaxResult getOrderInformation() {
        Map<String,String> resultMap = new HashMap<>();
        List list = new ArrayList<>();
        Map<String,Object> resultMap = new HashMap<>();
        List<OmProductionOrdeInfo> orderList = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().orderByDesc(OmProductionOrdeInfo::getCreateTime));
        OmProductionOrdeInfo order = orderList.get(0); // 获取最新的一条订单信息
        String workOrderNo = order.getWorkOrderNo();
@@ -37,9 +38,14 @@
                .eq(OmProductionOrdeInfo::getOrderStatus,"3")
                .eq(OmProductionOrdeInfo::getWorkOrderNo,workOrderNo)
        );
        double percent = (double) finishNum.size() / order.getPlanQty() * 100;  // 将百分比表示为小数
        int roundedPercent = (int) Math.round(percent);  // 四舍五入到整数
        list.add(roundedPercent);
        list.add(roundedPercent);
        resultMap.put("workOrderNo",workOrderNo);
        resultMap.put("planQty",order.getPlanQty().toString());
        resultMap.put("actualQty",String.valueOf(finishNum.size()));
        resultMap.put("waterLevel",list);
        return AjaxResult.success(resultMap);
    }
@@ -61,7 +67,7 @@
            lineData.add(omProductionOrdeInfo.getOrderCount());
        }
        map.put("category",category);
        map.put("lineData",lineData);
        map.put("barData",lineData);
        return AjaxResult.success(map);
    }