Commit ffc8a91273004333428a56abb91ce399376120c6
1 parent
0c5a157da1
Exists in
dev
#fix:优化小程序产妇服务开通查询逻辑
Showing 3 changed files with 58 additions and 40 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BirthController.java
View file @
ffc8a91
| ... | ... | @@ -100,17 +100,25 @@ |
| 100 | 100 | String history1 = JsonUtil.obj2JsonString(map.get("history")); |
| 101 | 101 | Map<String, Object> history = JsonUtil.str2Obj(history1, Map.class); |
| 102 | 102 | if (history.get("yqWeight")!=null&&history.get("height")!=null){ |
| 103 | - BigDecimal height= new BigDecimal(String.valueOf(history.get("height"))); | |
| 104 | - if (height.compareTo(BigDecimal.ZERO)>0){ | |
| 105 | - height=height.multiply(height); | |
| 103 | + try { | |
| 104 | + if (StringUtils.isNotEmpty(String.valueOf(history.get("height")))){ | |
| 105 | + BigDecimal height= new BigDecimal(String.valueOf(history.get("height"))); | |
| 106 | + if (height.compareTo(BigDecimal.ZERO)>0){ | |
| 107 | + height=height.multiply(height); | |
| 108 | + } | |
| 109 | + if (StringUtils.isNotEmpty(String.valueOf(history.get("yqWeight")))){ | |
| 110 | + BigDecimal bim= new BigDecimal(String.valueOf(history.get("yqWeight"))).divide(height,2, RoundingMode.HALF_UP); | |
| 111 | + if (bim.compareTo(new BigDecimal("28"))>0){ | |
| 112 | + Map<String,Object> map1=new HashMap<>(); | |
| 113 | + map1.put("idCard",archiveData.getIdCard()); | |
| 114 | + map1.put("BMI",bim.toPlainString()); | |
| 115 | + mapList.add(map1); | |
| 116 | + } | |
| 117 | + } | |
| 118 | + } | |
| 119 | + }catch (Exception e){ | |
| 120 | + System.out.println(history); | |
| 106 | 121 | } |
| 107 | - BigDecimal bim= new BigDecimal(String.valueOf(history.get("yqWeight"))).divide(height,2, RoundingMode.HALF_UP); | |
| 108 | - if (bim.compareTo(new BigDecimal("28"))>0){ | |
| 109 | - Map<String,Object> map1=new HashMap<>(); | |
| 110 | - map1.put("idCard",archiveData.getIdCard()); | |
| 111 | - map1.put("BMI",bim.toPlainString()); | |
| 112 | - mapList.add(map1); | |
| 113 | - } | |
| 114 | 122 | } |
| 115 | 123 | } |
| 116 | 124 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
View file @
ffc8a91
| ... | ... | @@ -350,7 +350,7 @@ |
| 350 | 350 | String id=courseModel.getId(); |
| 351 | 351 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 352 | 352 | patientsQuery.setHospitalId(courseModel.getHospitalId()); |
| 353 | - if (courseModel.getCourseObjId()!=null){ | |
| 353 | + if (courseModel.getCourseObjId()!=null&&courseModel.getCourseObjId()!=0){ | |
| 354 | 354 | patientsQuery.setType(courseModel.getCourseObjId()); |
| 355 | 355 | } |
| 356 | 356 | patientsQuery.setExtEnable(false); |
| 357 | 357 | |
| ... | ... | @@ -364,9 +364,12 @@ |
| 364 | 364 | List<MsgRequest> messages=new ArrayList<>(); |
| 365 | 365 | for (Patients model : patientsModels) |
| 366 | 366 | { |
| 367 | - messages= saveMsg(model.getHospitalId(),model.getPhone(),model.getId(), | |
| 367 | + List<MsgRequest> msgRequests= saveMsg(model.getHospitalId(),model.getPhone(),model.getId(), | |
| 368 | 368 | courseModel.getCourseName(),courseModel.getCourseSpeaker(),model.getId(),id, |
| 369 | 369 | "孕妇学校新课程已发布,点击进入小程序预约",1); |
| 370 | + if (CollectionUtils.isNotEmpty(msgRequests)){ | |
| 371 | + messages.addAll(msgRequests); | |
| 372 | + } | |
| 370 | 373 | } |
| 371 | 374 | |
| 372 | 375 | if (CollectionUtils.isNotEmpty(messages)) { |
| 373 | 376 | |
| ... | ... | @@ -415,9 +418,12 @@ |
| 415 | 418 | List<MsgRequest> messages=new ArrayList<>(); |
| 416 | 419 | for (PatientCourseModel model : patientCourseModels) |
| 417 | 420 | { |
| 418 | - messages= saveMsg(model.getHospitalId(),model.getPhone(),model.getPatientId(), | |
| 421 | + List<MsgRequest> msgRequests= saveMsg(model.getHospitalId(),model.getPhone(),model.getPatientId(), | |
| 419 | 422 | courseModel.getCourseName(),courseModel.getCourseSpeaker(),model.getId(),model.getCourseId(), |
| 420 | 423 | "您本次参加的孕妇学校课程已经取消,请注意安排时间。",null); |
| 424 | + if (CollectionUtils.isNotEmpty(msgRequests)){ | |
| 425 | + messages.addAll(msgRequests); | |
| 426 | + } | |
| 421 | 427 | } |
| 422 | 428 | |
| 423 | 429 | if (CollectionUtils.isNotEmpty(messages)) { |
| 424 | 430 | |
| ... | ... | @@ -572,9 +578,12 @@ |
| 572 | 578 | } |
| 573 | 579 | |
| 574 | 580 | String courseName = CollectionUtils.isNotEmpty(courseModels1) ? courseModels1.get(0).getCourseName() : ""; |
| 575 | - messages= saveMsg(patientCourseModel.getHospitalId(),patientCourseModel.getPhone(),patientCourseModel.getPatientId(), | |
| 581 | + List<MsgRequest> msgRequests= saveMsg(patientCourseModel.getHospitalId(),patientCourseModel.getPhone(),patientCourseModel.getPatientId(), | |
| 576 | 582 | courseName,speaker,patientCourseModel.getId(),patientCourseModel.getCourseId(), |
| 577 | 583 | "您本次参加的孕妇学校课程已经结束,请点击详情回顾课程内容并对本次课程评分。我们会根据您的评价结果相应做相应的评估的课程调整等。",null); |
| 584 | + if (CollectionUtils.isNotEmpty(msgRequests)){ | |
| 585 | + messages.addAll(msgRequests); | |
| 586 | + } | |
| 578 | 587 | } |
| 579 | 588 | if (CollectionUtils.isNotEmpty(messages)) { |
| 580 | 589 | logger.info("messages{},"+messages.toString()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
ffc8a91
| ... | ... | @@ -4347,40 +4347,41 @@ |
| 4347 | 4347 | List<MaternalDeliverModel> list = mongoTemplate.find(query, MaternalDeliverModel.class); |
| 4348 | 4348 | if (CollectionUtils.isNotEmpty(list)) { |
| 4349 | 4349 | //高危因素 |
| 4350 | - List<String> riskId = patientsList.get(0).getRiskFactorId(); | |
| 4351 | - StringBuffer sb = new StringBuffer(); | |
| 4352 | - if (CollectionUtils.isNotEmpty(riskId)) { | |
| 4353 | - HighScoreResult highScoreResult = queryRisk(riskId); | |
| 4354 | - List<Map> riskList = highScoreResult.getHighRisk(); | |
| 4355 | - if (CollectionUtils.isNotEmpty(riskList)) { | |
| 4356 | - for (Map risk : riskList) { | |
| 4357 | - sb.append(risk.get("name")).append(","); | |
| 4358 | - } | |
| 4359 | - } | |
| 4360 | - } | |
| 4361 | - | |
| 4362 | - String highRisk = sb.toString(); | |
| 4363 | - if (highRisk.length() > 0) { | |
| 4364 | - params.put("riskType", highRisk.substring(0, highRisk.length() - 1)); | |
| 4365 | - } | |
| 4366 | 4350 | MaternalDeliverModel maternalDeliverModel = list.get(0); |
| 4367 | 4351 | String dueDate = maternalDeliverModel.getDueDate() + " 00:00:00"; |
| 4368 | 4352 | //分娩类型 基于ID查询对应文章 |
| 4369 | 4353 | String deliveryMode = getDelivery(maternalDeliverModel); |
| 4370 | 4354 | params.put("dueDate", dueDate.equals("") ? dueDate : getTime(DateUtil.parseYMDHMS(dueDate))); |
| 4371 | 4355 | params.put("deliveryMode", deliveryMode); |
| 4372 | - PatientServiceQuery serviceQueryQuery = new PatientServiceQuery(); | |
| 4373 | - //产后康复 | |
| 4374 | - serviceQueryQuery.setSerType(20); | |
| 4375 | - serviceQueryQuery.setPerType(3); | |
| 4376 | - //服务状态1-开通、2-退订、3-过期、4-暂停 | |
| 4377 | - serviceQueryQuery.setSerStatus(1); | |
| 4378 | - serviceQueryQuery.setParentid(maternalDeliverModel.getParentId()); | |
| 4379 | - List<PatientService> patientServices = patientServiceService.queryPatientService(serviceQueryQuery); | |
| 4380 | - params.put("status",CollectionUtils.isNotEmpty(patientServices)?1:0); | |
| 4381 | 4356 | params.put("parentId",maternalDeliverModel.getParentId()); |
| 4382 | - objectResponse.setData(params); | |
| 4357 | + | |
| 4383 | 4358 | } |
| 4359 | + List<String> riskId = patientsList.get(0).getRiskFactorId(); | |
| 4360 | + StringBuffer sb = new StringBuffer(); | |
| 4361 | + if (CollectionUtils.isNotEmpty(riskId)) { | |
| 4362 | + HighScoreResult highScoreResult = queryRisk(riskId); | |
| 4363 | + List<Map> riskList = highScoreResult.getHighRisk(); | |
| 4364 | + if (CollectionUtils.isNotEmpty(riskList)) { | |
| 4365 | + for (Map risk : riskList) { | |
| 4366 | + sb.append(risk.get("name")).append(","); | |
| 4367 | + } | |
| 4368 | + } | |
| 4369 | + } | |
| 4370 | + | |
| 4371 | + String highRisk = sb.toString(); | |
| 4372 | + if (highRisk.length() > 0) { | |
| 4373 | + params.put("riskType", highRisk.substring(0, highRisk.length() - 1)); | |
| 4374 | + } | |
| 4375 | + PatientServiceQuery serviceQueryQuery = new PatientServiceQuery(); | |
| 4376 | + //产后康复 | |
| 4377 | + serviceQueryQuery.setSerType(20); | |
| 4378 | + serviceQueryQuery.setPerType(3); | |
| 4379 | + //服务状态1-开通、2-退订、3-过期、4-暂停 | |
| 4380 | + serviceQueryQuery.setSerStatus(1); | |
| 4381 | + serviceQueryQuery.setParentid(patientsList.get(0).getId()); | |
| 4382 | + List<PatientService> patientServices = patientServiceService.queryPatientService(serviceQueryQuery); | |
| 4383 | + params.put("status",CollectionUtils.isNotEmpty(patientServices)?1:0); | |
| 4384 | + objectResponse.setData(params); | |
| 4384 | 4385 | } |
| 4385 | 4386 | return objectResponse; |
| 4386 | 4387 | } |