import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
public class FrontDataUtils {
public static void frontDataCalculate(Object o){
for (Field f : o.getClass().getDeclaredFields()) {
String name = f.getName();
name = name.substring(0, 1).toUpperCase() + name.substring(1);
try {
Method m = o.getClass().getMethod("get" + name);
Method s = o.getClass().getMethod("set" + name, BigDecimal.class);
BigDecimal value = (BigDecimal) m.invoke(o);
if(value!=null){
value=value.divide(BigDecimal.valueOf(10000)).setScale(0,BigDecimal.ROUND_DOWN);
s.invoke(o,value);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}