package com.usky.vpp.util;

/**
 * 资源看板/概览模拟数据生成（已停用，保留注释备查）
 */
public final class VppResourceMockHelper {

    private VppResourceMockHelper() {
    }

    /*
    import com.usky.vpp.domain.VppDevice;
    import com.usky.vpp.domain.VppResourcePoint;

    import java.math.BigDecimal;
    import java.math.RoundingMode;
    import java.time.LocalDateTime;
    import java.util.concurrent.ThreadLocalRandom;

    public static BigDecimal mockSocPercent(VppResourcePoint resource) {
        if (!"ESS".equalsIgnoreCase(resource.getResourceType())) {
            return null;
        }
        return BigDecimal.valueOf(20 + pseudoRandom(resource.getId(), 2) * 70).setScale(1, RoundingMode.HALF_UP);
    }

    public static BigDecimal mockEvcsChargePowerKw(VppResourcePoint resource) {
        if (!"EVCS".equalsIgnoreCase(resource.getResourceType())) {
            return null;
        }
        BigDecimal base = resource.getCapacityKw() != null ? resource.getCapacityKw() : BigDecimal.valueOf(60);
        return base.multiply(BigDecimal.valueOf(0.2 + pseudoRandom(resource.getId(), 3) * 0.7))
                .setScale(2, RoundingMode.HALF_UP);
    }

    public static String resourceTypeLabel(String resourceType) {
        if (resourceType == null) {
            return "未知";
        }
        switch (resourceType.toUpperCase()) {
            case "PV":
                return "光伏";
            case "ESS":
                return "储能";
            case "EVCS":
                return "充电桩";
            case "IND_LOAD":
                return "工业负荷";
            case "COM_BLDG":
                return "商业楼宇";
            default:
                return resourceType;
        }
    }

    private static double pseudoRandom(Long seed, int salt) {
        if (seed == null) {
            return ThreadLocalRandom.current().nextDouble();
        }
        long mixed = seed * 31L + salt + LocalDateTime.now().getMinute();
        return (mixed % 1000) / 1000.0;
    }
    */
}
