Commit 341ef06349ed666e47692f6e6c69fcc5ddabe539
1 parent
aa86864f8b
Exists in
master
and in
8 other branches
update code
Showing 3 changed files with 11 additions and 16 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
341ef06
| ... | ... | @@ -304,14 +304,14 @@ |
| 304 | 304 | public static Date addMonth(Date srcDate, int month) { |
| 305 | 305 | Calendar rightNow = Calendar.getInstance(); |
| 306 | 306 | rightNow.setTime(srcDate); |
| 307 | - rightNow.add(Calendar.DAY_OF_MONTH, month); | |
| 307 | + rightNow.add(Calendar.MONTH, month); | |
| 308 | 308 | return rightNow.getTime(); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | public static Date addYear(Date srcDate, int year) { |
| 312 | 312 | Calendar rightNow = Calendar.getInstance(); |
| 313 | 313 | rightNow.setTime(srcDate); |
| 314 | - rightNow.add(Calendar.DAY_OF_YEAR, year); | |
| 314 | + rightNow.add(Calendar.YEAR, year); | |
| 315 | 315 | return rightNow.getTime(); |
| 316 | 316 | } |
| 317 | 317 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
View file @
341ef06
| ... | ... | @@ -164,8 +164,8 @@ |
| 164 | 164 | public BaseListResponse queryBabyList(@RequestParam(value = "mcardNo", required = false) String mcardNo, |
| 165 | 165 | @RequestParam(value = "bcardNo", required = false) String bcardNo, |
| 166 | 166 | @RequestParam(value = "mphone", required = false) String mphone, |
| 167 | - @RequestParam(value = "monthAge", required = false) Integer startMonthAge, | |
| 168 | - @RequestParam(value = "monthAge", required = false) Integer endMonthAge, | |
| 167 | + @RequestParam(value = "startMonthAge", required = false) Integer startMonthAge, | |
| 168 | + @RequestParam(value = "endMonthAge", required = false) Integer endMonthAge, | |
| 169 | 169 | @RequestParam(value = "birth", required = false) String birth, |
| 170 | 170 | @RequestParam(value = "nextDate", required = false) String nextDate, |
| 171 | 171 | @RequestParam(value = "expVip", required = false) Integer expVip, |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
341ef06
| ... | ... | @@ -699,7 +699,7 @@ |
| 699 | 699 | */ |
| 700 | 700 | public BaseListResponse queryBabyList(BabyManageRequest request) { |
| 701 | 701 | BabyModelQuery babyQuery = new BabyModelQuery(); |
| 702 | - List<BabyModel> models = getBabayListByCondition(request,true,babyQuery); | |
| 702 | + List<BabyModel> models = getBabayListByCondition(request, true, babyQuery); | |
| 703 | 703 | List<BabyManageListResult> list = new ArrayList<>(); |
| 704 | 704 | if(CollectionUtils.isNotEmpty(models)) |
| 705 | 705 | { |
| 706 | 706 | |
| ... | ... | @@ -768,18 +768,11 @@ |
| 768 | 768 | babyQuery.setCardNo(request.getBcardNo()); |
| 769 | 769 | babyQuery.setName(request.getName()); |
| 770 | 770 | babyQuery.setMphone(request.getMphone()); |
| 771 | - if (request.getMonthAgeStart() != null || request.getMonthAgeEnd() != null) | |
| 771 | + if (request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) | |
| 772 | 772 | { |
| 773 | - if (request.getMonthAgeStart() != null) | |
| 774 | - { | |
| 775 | - request.setMonthAgeEnd(request.getMonthAgeStart()); | |
| 776 | - } | |
| 777 | - else | |
| 778 | - { | |
| 779 | - request.setMonthAgeStart(request.getMonthAgeEnd()); | |
| 780 | - } | |
| 781 | - Date start = DateUtil.addMonth(new Date(),request.getMonthAgeStart()); | |
| 782 | - Date end = DateUtil.addMonth(new Date(),request.getMonthAgeEnd()); | |
| 773 | + | |
| 774 | + Date start = DateUtil.addMonth(new Date(),-request.getMonthAgeStart()); | |
| 775 | + Date end = DateUtil.addMonth(new Date(),-request.getMonthAgeEnd()); | |
| 783 | 776 | babyQuery.setBirthStart(end); |
| 784 | 777 | babyQuery.setBirthEnd(start); |
| 785 | 778 | } |
| ... | ... | @@ -885,5 +878,7 @@ |
| 885 | 878 | objectResponse.setErrormsg("成功"); |
| 886 | 879 | return objectResponse; |
| 887 | 880 | } |
| 881 | + | |
| 882 | + | |
| 888 | 883 | } |