diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java index e870ed9..19f8482 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java @@ -304,14 +304,14 @@ public class DateUtil { public static Date addMonth(Date srcDate, int month) { Calendar rightNow = Calendar.getInstance(); rightNow.setTime(srcDate); - rightNow.add(Calendar.DAY_OF_MONTH, month); + rightNow.add(Calendar.MONTH, month); return rightNow.getTime(); } public static Date addYear(Date srcDate, int year) { Calendar rightNow = Calendar.getInstance(); rightNow.setTime(srcDate); - rightNow.add(Calendar.DAY_OF_YEAR, year); + rightNow.add(Calendar.YEAR, year); return rightNow.getTime(); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java index 3521dbc..c24b0be 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java @@ -164,8 +164,8 @@ public class BabyBookbuildingController extends BaseController{ public BaseListResponse queryBabyList(@RequestParam(value = "mcardNo", required = false) String mcardNo, @RequestParam(value = "bcardNo", required = false) String bcardNo, @RequestParam(value = "mphone", required = false) String mphone, - @RequestParam(value = "monthAge", required = false) Integer startMonthAge, - @RequestParam(value = "monthAge", required = false) Integer endMonthAge, + @RequestParam(value = "startMonthAge", required = false) Integer startMonthAge, + @RequestParam(value = "endMonthAge", required = false) Integer endMonthAge, @RequestParam(value = "birth", required = false) String birth, @RequestParam(value = "nextDate", required = false) String nextDate, @RequestParam(value = "expVip", required = false) Integer expVip, diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java index 2021667..96861ac 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java @@ -699,7 +699,7 @@ public class BabyBookbuildingFacade { */ public BaseListResponse queryBabyList(BabyManageRequest request) { BabyModelQuery babyQuery = new BabyModelQuery(); - List models = getBabayListByCondition(request,true,babyQuery); + List models = getBabayListByCondition(request, true, babyQuery); List list = new ArrayList<>(); if(CollectionUtils.isNotEmpty(models)) { @@ -768,18 +768,11 @@ public class BabyBookbuildingFacade { babyQuery.setCardNo(request.getBcardNo()); babyQuery.setName(request.getName()); babyQuery.setMphone(request.getMphone()); - if (request.getMonthAgeStart() != null || request.getMonthAgeEnd() != null) + if (request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) { - if (request.getMonthAgeStart() != null) - { - request.setMonthAgeEnd(request.getMonthAgeStart()); - } - else - { - request.setMonthAgeStart(request.getMonthAgeEnd()); - } - Date start = DateUtil.addMonth(new Date(),request.getMonthAgeStart()); - Date end = DateUtil.addMonth(new Date(),request.getMonthAgeEnd()); + + Date start = DateUtil.addMonth(new Date(),-request.getMonthAgeStart()); + Date end = DateUtil.addMonth(new Date(),-request.getMonthAgeEnd()); babyQuery.setBirthStart(end); babyQuery.setBirthEnd(start); } @@ -885,4 +878,6 @@ public class BabyBookbuildingFacade { objectResponse.setErrormsg("成功"); return objectResponse; } + + } \ No newline at end of file