From 2f52aa10a8f052f929b4da230276c358968e17b7 Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Wed, 25 Sep 2024 12:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/common/util/date/DateUtils.java | 16 ++++++++++++++++ .../admin/ultrasonic/ultrasonicController.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) 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();