Commit 8ea8aaaa5f5221f01b17301cac1961a7e2090af9
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
8ea8aaa
| ... | ... | @@ -95,7 +95,7 @@ |
| 95 | 95 | @TokenRequired |
| 96 | 96 | public BaseObjectResponse queryChooseBabys(HttpServletRequest request,@RequestParam(required = false)String vcCardNo,@RequestParam(required = false)String cardNo){ |
| 97 | 97 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 98 | - return babyCheckFacade.queryChooseBabys(vcCardNo, cardNo,loginState.getId()); | |
| 98 | + return babyCheckFacade.queryChooseBabys(vcCardNo, cardNo, loginState.getId()); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| ... | ... | @@ -148,6 +148,18 @@ |
| 148 | 148 | @ResponseBody |
| 149 | 149 | public BaseObjectResponse getBaseConfig(){ |
| 150 | 150 | return babyCheckFacade.getBaseConfig(); |
| 151 | + | |
| 152 | + } | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * 计算儿童月龄 | |
| 156 | + */ | |
| 157 | + @RequestMapping(value = "/getBabyMonthAge", method = RequestMethod.GET) | |
| 158 | + @ResponseBody | |
| 159 | + public BaseObjectResponse getBabyMonthAge( | |
| 160 | + @RequestParam(required = true) String birth, | |
| 161 | + @RequestParam(required = false) String checkDate){ | |
| 162 | + return babyCheckFacade.getBabyMonthAge(birth,checkDate); | |
| 151 | 163 | |
| 152 | 164 | } |
| 153 | 165 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
8ea8aaa
| ... | ... | @@ -538,8 +538,8 @@ |
| 538 | 538 | results.add(result); |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | - map.put("isBuild",isBuild); | |
| 542 | - map.put("boies",results); | |
| 541 | + map.put("isBuild", isBuild); | |
| 542 | + map.put("boies", results); | |
| 543 | 543 | br.setData(map); |
| 544 | 544 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 545 | 545 | br.setErrormsg("成功"); |
| ... | ... | @@ -869,6 +869,22 @@ |
| 869 | 869 | map.put("organizations", antenatalExaminationFacade.convert()); |
| 870 | 870 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
| 871 | 871 | objectResponse.setData(map); |
| 872 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 873 | + objectResponse.setErrormsg("成功"); | |
| 874 | + | |
| 875 | + return objectResponse; | |
| 876 | + } | |
| 877 | + | |
| 878 | + public BaseObjectResponse getBabyMonthAge(String birth, String checkDate) { | |
| 879 | + Date birthDate = DateUtil.parseYMD(birth); | |
| 880 | + Date date = new Date(); | |
| 881 | + if (StringUtils.isNotEmpty(checkDate)) | |
| 882 | + { | |
| 883 | + date = DateUtil.parseYMD(checkDate); | |
| 884 | + } | |
| 885 | + String ageStr = DateUtil.getBabyMonthAge(birthDate,date); | |
| 886 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 887 | + objectResponse.setData(ageStr); | |
| 872 | 888 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 873 | 889 | objectResponse.setErrormsg("成功"); |
| 874 | 890 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
8ea8aaa
| ... | ... | @@ -298,20 +298,86 @@ |
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | -// if (templateModel == null) | |
| 302 | -// { | |
| 303 | -// for (SmsTemplateModel temp : temps) | |
| 304 | -// { | |
| 305 | -// if (temp.getServiceType() == serviceType) | |
| 306 | -// { | |
| 307 | -// templateModel = temp; | |
| 308 | -// break; | |
| 309 | -// } | |
| 310 | -// } | |
| 311 | -// } | |
| 301 | + if (templateModel == null) | |
| 302 | + { | |
| 303 | + for (SmsTemplateModel temp : temps) | |
| 304 | + { | |
| 305 | + if (temp.getServiceStatus() == serviceStatus) | |
| 306 | + { | |
| 307 | + templateModel = temp; | |
| 308 | + break; | |
| 309 | + } | |
| 310 | + } | |
| 311 | + } | |
| 312 | 312 | |
| 313 | + if (templateModel == null) | |
| 314 | + { | |
| 315 | + for (SmsTemplateModel temp : temps) | |
| 316 | + { | |
| 317 | + if (temp.getServiceType() == serviceType) | |
| 318 | + { | |
| 319 | + templateModel = temp; | |
| 320 | + break; | |
| 321 | + } | |
| 322 | + } | |
| 323 | + } | |
| 313 | 324 | |
| 325 | + if (templateModel == null) | |
| 326 | + { | |
| 327 | + for (SmsTemplateModel temp : temps) | |
| 328 | + { | |
| 329 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OPEN.getId()) | |
| 330 | + { | |
| 331 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.ADD_OPEN.getId() ) | |
| 332 | + { | |
| 333 | + templateModel = temp; | |
| 334 | + break; | |
| 335 | + } | |
| 336 | + } | |
| 337 | + } | |
| 338 | + } | |
| 314 | 339 | |
| 340 | + if (templateModel == null) | |
| 341 | + { | |
| 342 | + for (SmsTemplateModel temp : temps) | |
| 343 | + { | |
| 344 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_NO_OPEN.getId()) | |
| 345 | + { | |
| 346 | + if (serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId() ) | |
| 347 | + { | |
| 348 | + templateModel = temp; | |
| 349 | + break; | |
| 350 | + } | |
| 351 | + } | |
| 352 | + } | |
| 353 | + } | |
| 354 | + | |
| 355 | + if (templateModel == null) | |
| 356 | + { | |
| 357 | + for (SmsTemplateModel temp : temps) | |
| 358 | + { | |
| 359 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OVERDUE.getId()) | |
| 360 | + { | |
| 361 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId() ) | |
| 362 | + { | |
| 363 | + templateModel = temp; | |
| 364 | + break; | |
| 365 | + } | |
| 366 | + } | |
| 367 | + } | |
| 368 | + } | |
| 369 | + | |
| 370 | + if (templateModel == null) | |
| 371 | + { | |
| 372 | + for (SmsTemplateModel temp : temps) | |
| 373 | + { | |
| 374 | + if (temp.getServiceType() == ServiceTypeEnums.ADD_SERVICE.getId() && temp.getServiceStatus() == ServiceStatusEnums.ALL.getId()) | |
| 375 | + { | |
| 376 | + templateModel = temp; | |
| 377 | + break; | |
| 378 | + } | |
| 379 | + } | |
| 380 | + } | |
| 315 | 381 | |
| 316 | 382 | if (templateModel != null && templateModel.getStatus() == 1) |
| 317 | 383 | { |