Commit 455138842ea895f23fc8f4536271859f85b5db3d

Authored by liquanyu
1 parent 7bf7d0291e

月龄计算

Showing 2 changed files with 4 additions and 4 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 4551388
... ... @@ -412,7 +412,7 @@
412 412  
413 413 int month = getMonthSpace(birth,rightNow.getTime());
414 414  
415   - return year+"岁"+ (month == 0 ? "" : month+"月");
  415 + return year+"岁"+ (month == 0 ? "" : month+"月");
416 416 }
417 417  
418 418 public static int daysBetween(Date smdate,Date bdate)
... ... @@ -451,7 +451,7 @@
451 451  
452 452 result = c2.get(Calendar.MONDAY) - c1.get(Calendar.MONTH);
453 453  
454   - return result == 0 ? 1 : Math.abs(result);
  454 + return result == 0 ? 1 : Math.abs(result)-1;
455 455  
456 456 }
457 457  
... ... @@ -559,7 +559,7 @@
559 559 System.out.println(new DateTime().minusDays(77));*/
560 560 // System.out.println(getDaySeconds());
561 561  
562   - String s = getBabyMonthAge(parseYMD("2016-06-26"), new Date());
  562 + String s = getBabyMonthAge(parseYMD("2016-05-16"), new Date());
563 563 System.out.println(s);
564 564 // SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd ");
565 565 // System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date()));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 4551388
... ... @@ -260,7 +260,7 @@
260 260 Date dueDate = patients.getDueDate();
261 261 if (dueDate != null && request.getBabyBirthday() != null) {
262 262 Date brith = DateUtil.parseYMD(request.getBabyBirthday());
263   - Date tempDate = DateUtil.addDay(dueDate, -60);
  263 + Date tempDate = DateUtil.addMonth(dueDate, -2);
264 264 if (brith.getTime() > tempDate.getTime()) {
265 265 //设置孕妇已分娩
266 266 Patients patientUpdate = new Patients();