diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java index 65d697fe1..58d3fd830 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java @@ -183,4 +183,20 @@ public class DateUtils { LocalDate currentDate = LocalDate.now(); // 获取当前日期 return String.valueOf(Period.between(birthDate, currentDate).getYears()); // 计算两个日期之间的年份差 } + /** + * 时间戳转换出生日期 + * + */ + public static String formatedcsrq(long timestamp) + { + + // 创建Date对象 + Date date = new Date(timestamp); + + // 创建SimpleDateFormat对象,并设置日期格式 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + + // 格式化日期 + return sdf.format(date); + } } diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java index f720520a4..41b0284b0 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java @@ -505,7 +505,7 @@ public class ultrasonicController { //获取基础信息 String PatientID=patientInfo.getPatientID(); String PatientNam=patientInfo.getPatientNam(); - String PatientBir=patientInfo.getPatientBir(); + String PatientBir=DateUtils.formatedcsrq(Long.parseLong(patientInfo.getPatientBir())) ; String PatientSex=patientInfo.getPatientSex(); String AccessTime= DateUtils.timestamp(); String orgId=patientInfo.getOrgId();