Commit 4600d759daf5bc43511ad175c139c20018aa67e8

Authored by litao@lymsh.com
1 parent e6b0b05d63

体重管理相关代码

Showing 2 changed files with 16 additions and 1 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 4600d75
... ... @@ -975,6 +975,21 @@
975 975 }
976 976  
977 977 /**
  978 + * 获取孕周
  979 + * @param start
  980 + * @param end
  981 + * @return
  982 + */
  983 + public static Integer getWeek2(Date start, Date end) {
  984 + if(start == null || end == null) {
  985 + return null;
  986 + }
  987 + Integer betweenDay = DateUtil.getDays(start, end);
  988 + Integer week = betweenDay / 7;
  989 + return week;
  990 + }
  991 +
  992 + /**
978 993 * 获取两个日期相差几个月
979 994 * @param start
980 995 * @param end
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 4600d75
... ... @@ -222,7 +222,7 @@
222 222 map.put("phone", patients.getPhone());
223 223 map.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate()));
224 224 map.put("age", DateUtil.getAge(patients.getBirth()));
225   - week = DateUtil.getWeek(patients.getLastMenses(), new Date());
  225 + week = DateUtil.getWeek2(patients.getLastMenses(), new Date());
226 226 String yunqi = "";
227 227 if(week <= 12) {
228 228 yunqi = "孕早期";