diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java index dd508bb..ac273f5 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java +++ b/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; }