Browse Source

# 第一种工作票预览

zhongwei
haungxing 12 months ago
parent
commit
586bde7001
  1. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java

15
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java

@ -48,6 +48,21 @@ public class ObjectUtils {
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second",time.getSecond());
}
}
else if(value instanceof Date) {
DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class);
Date time = (Date) value;
if(ObjectUtil.isEmpty(dateTimeToMap)) {
result.put(field.getName(),DateUtil.format(time,DateUtil.PATTERN_DATETIME));
}
else {
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"year",time.getYear());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"month",time.getMonth());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"day",time.getDay());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"hour",time.getHours());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"minute",time.getMinutes());
result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second",time.getSeconds());
}
}
});
return result;
}

Loading…
Cancel
Save