Commit efbbb7c3219af83b71cb6489ca84236ced4c070d

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 2 changed files

platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ efbbb7c
... ... @@ -523,7 +523,7 @@
523 523 }else if(type.equals("天".trim())){
524 524 rightNow.add(Calendar.DAY_OF_YEAR,num);
525 525 }
526   - rightNow.add(Calendar.DAY_OF_YEAR,delayDay);
  526 + rightNow.add(Calendar.DAY_OF_YEAR, delayDay);
527 527 String date = y_m_d.format(rightNow.getTime());
528 528 System.out.println(date);
529 529 return rightNow.getTime();
... ... @@ -550,6 +550,13 @@
550 550 return rightNow.getTime();
551 551 }
552 552  
  553 + public static Date formatDate(Date date)
  554 + {
  555 + String time = y_m_d.format(date);
  556 + return parseYMD(time);
  557 + }
  558 +
  559 +
553 560 public static void main(String[] arg) {
554 561 /* Date today = new Date(1448336360000L);
555 562  
... ... @@ -559,8 +566,8 @@
559 566 System.out.println(new DateTime().minusDays(77));*/
560 567 // System.out.println(getDaySeconds());
561 568  
562   - String s = getBabyMonthAge(parseYMD("2016-05-16"), new Date());
563   - System.out.println(s);
  569 +// String s = getBabyMonthAge(parseYMD("2016-05-16"), new Date());
  570 +// System.out.println(s);
564 571 // SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd ");
565 572 // System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date()));
566 573 // System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108)));
... ... @@ -574,9 +581,11 @@
574 581 // Date startDate = DateUtil.addDay(new Date(), 2);
575 582 // System.out.println(getyyyy_MM_dd(startDate));
576 583 try {
577   -// Date d = md.parse("07-02");
578   -// Date startDate = DateUtil.addDay(d, -2);
579   -// System.out.println(dd.format(startDate));
  584 +
  585 + Date startDate = DateUtil.addMonth(new Date(), -1);
  586 + Date endtDate = DateUtil.addMonth(new Date(), -2);
  587 + System.out.println(y_m_d_h_m_s.format(startDate));
  588 + System.out.println(y_m_d_h_m_s.format(endtDate));
580 589  
581 590 // Date sendDate = dd.parse("02");
582 591 // String md = DateUtil.getMMdd(new Date());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ efbbb7c
... ... @@ -1278,8 +1278,9 @@
1278 1278 babyQuery.setMphone(request.getMphone());
1279 1279 if (request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) {
1280 1280  
1281   - Date start = DateUtil.addMonth(new Date(), -request.getMonthAgeStart());
1282   - Date end = DateUtil.addMonth(new Date(), -request.getMonthAgeEnd());
  1281 + Date currentDate = DateUtil.formatDate(new Date());
  1282 + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart());
  1283 + Date end = DateUtil.addMonth(currentDate, -request.getMonthAgeEnd()-1);
1283 1284 babyQuery.setBirthStart(end);
1284 1285 babyQuery.setBirthEnd(start);
1285 1286 }