野心家
2025-06-19 4d44953d342fb0f7a1b9726eeaa9a35ba2b7548c
src/main/java/com/zy/asrs/utils/Utils.java
@@ -4,9 +4,12 @@
import com.core.common.Cools;
import com.zy.core.properties.SlaveProperties;
import java.lang.reflect.Field;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by vincent on 2020/8/27
@@ -161,6 +164,20 @@
    }
    public static Map<String, Object> objectToMap(Object obj) {
        Map<String, Object> map = new HashMap<>();
        Field[] fields = obj.getClass().getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true); // 设置私有字段可访问
            try {
                map.put(field.getName(), field.get(obj));
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return map;
    }
    public static void main(String[] args) {
        SlaveProperties slaveProperties = new SlaveProperties();
        slaveProperties.setDoubleDeep(true);