Commit f6bb02c6e7c749192c73fe8841fc62a638e7481a
1 parent
01eefb695d
Exists in
master
and in
3 other branches
修改新电子病历
Showing 2 changed files with 9 additions and 1 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
f6bb02c
| ... | ... | @@ -54,6 +54,14 @@ |
| 54 | 54 | Long age = m / 31536000000L; |
| 55 | 55 | return age.intValue(); |
| 56 | 56 | } |
| 57 | + public static Integer getAge(Date birth,Date fmDate) { | |
| 58 | + if (birth == null) { | |
| 59 | + return null; | |
| 60 | + } | |
| 61 | + long m = fmDate.getTime() - birth.getTime(); | |
| 62 | + Long age = m / 31536000000L; | |
| 63 | + return age.intValue(); | |
| 64 | + } | |
| 57 | 65 | |
| 58 | 66 | public static Integer getWeek(Date date) { |
| 59 | 67 | if (date == null) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
View file @
f6bb02c
| ... | ... | @@ -156,7 +156,7 @@ |
| 156 | 156 | @Override |
| 157 | 157 | public QuanChanResult convertToResult(Patients destModel) { |
| 158 | 158 | setId(destModel.getId()); |
| 159 | - setAge(destModel.getAge()); | |
| 159 | + setAge(DateUtil.getAge(destModel.getBirth(),destModel.getFmDate())); | |
| 160 | 160 | setName(destModel.getUsername()); |
| 161 | 161 | setPhone(StringUtils.encryPhone(destModel.getPhone())); |
| 162 | 162 |