微调
This commit is contained in:
@@ -218,6 +218,25 @@ public class PubUtils {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于获取对象中,前缀一样,后缀为2~50的属性值
|
||||
*
|
||||
* @param object 待操作对象
|
||||
* @param methodPrefix 方法前缀
|
||||
* @param number 方法后缀
|
||||
* @return 对象属性值
|
||||
*/
|
||||
public static Double getValueByMethodDouble(Object object, String methodPrefix, Integer number) {
|
||||
try {
|
||||
Method method = object.getClass().getMethod(methodPrefix + number);
|
||||
return (Double) method.invoke(object);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(CommonResponseEnum.REFLECT_METHOD_EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static List<String> getStartTimeEndTime(String beginDate, String endDate) throws Exception {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Reference in New Issue
Block a user