自动化立体仓库 - WMS系统
zyh
14 小时以前 fb13d79f33ee8dced242fabf2d66950ae8689400
src/main/java/com/zy/asrs/service/impl/DigitalTwinServiceImpl.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.LocCount;
import com.zy.asrs.entity.LocDetl;
@@ -374,5 +373,56 @@
        return result;
    }
    public Map<String, Object> getLocInfo() {
        List<LocMast> LocMasts = locMastMapper.selectList(new EntityWrapper<>());
        Map<String, Object> result = new HashMap<>();
        // 初始化计数器
        int emptyLocCount = 0;
        int fullZpalletCount = 0;
        int emptyZpalletCount = 0;
        int pickOutCount = 0;
        int pickInCount = 0;
        int outboundCount = 0;
        int inboundCount = 0;
        int disableCount = 0;
        int mergeCount = 0;
        // 统计每种状态的库位数量
        for (LocMast locMast : LocMasts) {
            String locSts = locMast.getLocSts();
            if (locSts.equals("O")) {
                emptyLocCount++;
            } else if (locSts.equals("F")) {
                fullZpalletCount++;
            } else if (locSts.equals("D")) {
                emptyZpalletCount++;
            } else if (locSts.equals("P")) {
                pickOutCount++;
            } else if (locSts.equals("Q")) {
                pickInCount++;
            } else if (locSts.equals("R")) {
                outboundCount++;
            } else if (locSts.equals("S")) {
                inboundCount++;
            } else if (locSts.equals("X")) {
                disableCount++;
            } else if (locSts.equals("Y")) {
                mergeCount++;
            }
        }
        // 将统计结果放入Map中
        result.put("EmptyLoc", emptyLocCount);
        result.put("FullZpallet", fullZpalletCount);
        result.put("EmptyZpallet", emptyZpalletCount);
        result.put("PickOut", pickOutCount);
        result.put("PickIn", pickInCount);
        result.put("Outbound", outboundCount);
        result.put("Inbound", inboundCount);
        result.put("Disable", disableCount);
        result.put("Merge", mergeCount);
        return result;
    }
}