Commit 965bdc65c13c1f859099c482532ea5a2d460a0db
1 parent
d134d2b763
Exists in
master
and in
6 other branches
修复bug
Showing 3 changed files with 56 additions and 6 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NerveMovementListRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NerveMovementListRequest.java
View file @
965bdc6
| ... | ... | @@ -41,6 +41,19 @@ |
| 41 | 41 | private Integer startAbnormalSize; |
| 42 | 42 | private Integer endAbnormalSize; |
| 43 | 43 | |
| 44 | + /** | |
| 45 | + * 是否加密 1|是 2|否 | |
| 46 | + */ | |
| 47 | + private String isEncrypt = "2"; | |
| 48 | + | |
| 49 | + public String getIsEncrypt() { | |
| 50 | + return isEncrypt; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setIsEncrypt(String isEncrypt) { | |
| 54 | + this.isEncrypt = isEncrypt; | |
| 55 | + } | |
| 56 | + | |
| 44 | 57 | public String getStartCheckTime() { |
| 45 | 58 | return startCheckTime; |
| 46 | 59 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
View file @
965bdc6
| ... | ... | @@ -934,10 +934,18 @@ |
| 934 | 934 | mongoTemplate.updateFirst(Query.query(Criteria.where("_id").is(visitInfoModel.getId())), update, BabyAfterVisitInfoModel.class); |
| 935 | 935 | if (afterVisitWorkflow.equals(TrackDownTransferEnums.C.getId().toString())) { |
| 936 | 936 | // 终止所有流程 |
| 937 | - mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId).and("type").is("3")), Update.update("afterVisitWorkflow", "3"), BabyAfterVisitInfoModel.class); | |
| 938 | - mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId).and("type").is("2")), Update.update("afterVisitWorkflow", "3"), BabyAfterVisitInfoModel.class); | |
| 939 | - mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId)), Update.update("afterVisitWorkflowStatus", "2"), BabyAfterVisitStatisticsModel.class); | |
| 937 | + Update update1 = new Update(); | |
| 938 | + update1.set("afterVisitWorkflow", "3"); | |
| 939 | + update1.set("yn", 2); | |
| 940 | + mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId).and("type").is("3")), update1, BabyAfterVisitInfoModel.class); | |
| 941 | + mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId).and("type").is("2")), update1, BabyAfterVisitInfoModel.class); | |
| 942 | + mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId)), Update.update("afterVisitWorkflowStatus", "2").set("yn", 2), BabyAfterVisitStatisticsModel.class); | |
| 940 | 943 | } |
| 944 | + | |
| 945 | + if (afterVisitWorkflow.equals(TrackDownTransferEnums.B.getId().toString())) { | |
| 946 | + mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyId).and("type").is(type)), Update.update("afterVisitWorkflow", "2").set("yn", 2), BabyAfterVisitInfoModel.class); | |
| 947 | + } | |
| 948 | + | |
| 941 | 949 | |
| 942 | 950 | return new BaseResponse(); |
| 943 | 951 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
View file @
965bdc6
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | import com.lyms.platform.operate.web.request.*; |
| 11 | 11 | import com.lyms.platform.operate.web.service.BabyEvaluationCriterionService; |
| 12 | 12 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
| 13 | +import com.lyms.platform.operate.web.utils.EncryptUtil; | |
| 13 | 14 | import com.lyms.platform.permission.dao.master.MasterUsersMapper; |
| 14 | 15 | import com.lyms.platform.permission.model.Users; |
| 15 | 16 | import com.lyms.platform.pojo.*; |
| ... | ... | @@ -415,7 +416,7 @@ |
| 415 | 416 | * @return |
| 416 | 417 | */ |
| 417 | 418 | @Override |
| 418 | - public BaseResponse nerveMovementList(Integer userId, NerveMovementListRequest param) { | |
| 419 | + public BaseResponse nerveMovementList(Integer userId, final NerveMovementListRequest param) { | |
| 419 | 420 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 420 | 421 | Query query = new Query(); |
| 421 | 422 | query.addCriteria(Criteria.where("hospitalId").is(hospitalId).and("yn").is(YnEnums.YES.getId())); |
| ... | ... | @@ -479,8 +480,10 @@ |
| 479 | 480 | Users users = usersMapper.getUsers(Integer.parseInt(checkDoctor)); |
| 480 | 481 | String checkDoctorName = null != users ? users.getName() : ""; |
| 481 | 482 | stringMap.put("checkDoctorName", checkDoctorName); |
| 482 | - | |
| 483 | - // TODO 2019/7/29 18:02 dongqing | |
| 483 | + stringMap.put("checkTimeStr", DateUtil.getyyyy_MM_dd(model.getCheckTime())); | |
| 484 | + stringMap.put("checkMonth", DateUtil.getBabyMonthAge(model.getBirth(), model.getCheckTime())); | |
| 485 | + stringMap.put("mcertNo", "1".equals(param.getIsEncrypt()) ? EncryptUtil.numberEncrypt(model.getMcertNo()) : model.getMcertNo()); | |
| 486 | + stringMap.put("mphone", "1".equals(param.getIsEncrypt()) ? EncryptUtil.numberEncrypt(model.getMphone()) : model.getMphone()); | |
| 484 | 487 | add(stringMap); |
| 485 | 488 | } |
| 486 | 489 | }}; |
| ... | ... | @@ -667,6 +670,7 @@ |
| 667 | 670 | if (babyModel == null) { |
| 668 | 671 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("未查到该儿童的建档数据"); |
| 669 | 672 | } |
| 673 | + Integer month = DateUtil.getBabyAgeMonth(babyModel.getBirth(), new Date()); | |
| 670 | 674 | model.setBirth(babyModel.getBirth()); |
| 671 | 675 | model.setCardNo(babyModel.getCardNo()); |
| 672 | 676 | model.setVcCardNo(babyModel.getVcCardNo()); |
| 673 | 677 | |
| ... | ... | @@ -678,10 +682,16 @@ |
| 678 | 682 | model.setCreateTime(new Date()); |
| 679 | 683 | model.setCreateUser(userId.toString()); |
| 680 | 684 | model.setYn(YnEnums.YES.getId()); |
| 685 | + // 总分 | |
| 686 | + model.setTotalScore(model.getStandingComponent() + model.getSeatComponent() + model.getSupineComponent() + model.getLieProstratComponent()); | |
| 687 | + // 百分位 | |
| 688 | + BabyEvaluationCriterionModel babyEvaluationCriterionModel = getBabyEvaluationCriterionModel(model, month); | |
| 689 | + model.setPercentileScore(babyEvaluationCriterionModel.getPercent()); | |
| 681 | 690 | mongoTemplate.insert(model); |
| 682 | 691 | } |
| 683 | 692 | |
| 684 | 693 | if (StringUtils.isNotEmpty(id)) { |
| 694 | + Integer month = DateUtil.getBabyAgeMonth(model.getBirth(), new Date()); | |
| 685 | 695 | model.setCheckTime(null); |
| 686 | 696 | model.setCreateUser(null); |
| 687 | 697 | model.setCreateTime(null); |
| 688 | 698 | |
| ... | ... | @@ -696,10 +706,29 @@ |
| 696 | 706 | model.setCreateTime(null); |
| 697 | 707 | model.setCreateUser(null); |
| 698 | 708 | model.setYn(null); |
| 709 | + // 总分 | |
| 710 | + model.setTotalScore(model.getStandingComponent() + model.getSeatComponent() + model.getSupineComponent() + model.getLieProstratComponent()); | |
| 711 | + // 百分位 | |
| 712 | + BabyEvaluationCriterionModel babyEvaluationCriterionModel = getBabyEvaluationCriterionModel(model, month); | |
| 713 | + model.setPercentileScore(babyEvaluationCriterionModel.getPercent()); | |
| 699 | 714 | Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(model)); |
| 700 | 715 | mongoTemplate.updateFirst(Query.query(Criteria.where("_id").is(id)), update, ExerciseAppraisalModel.class); |
| 701 | 716 | } |
| 702 | 717 | return new BaseResponse(); |
| 718 | + } | |
| 719 | + | |
| 720 | + private BabyEvaluationCriterionModel getBabyEvaluationCriterionModel(ExerciseAppraisalModel model, Integer month) { | |
| 721 | + | |
| 722 | + Integer totalScore = model.getTotalScore(); | |
| 723 | + | |
| 724 | + List<BabyEvaluationCriterionModel> modelList = mongoTemplate.find(Query.query(Criteria.where("month").is(month).and("type").is(1)), BabyEvaluationCriterionModel.class); | |
| 725 | + BabyEvaluationCriterionModel evaluationCriterionModel = modelList.get(0); | |
| 726 | + Integer maxScore = evaluationCriterionModel.getMaxScore(); | |
| 727 | + Integer minScore = evaluationCriterionModel.getMinScore(); | |
| 728 | + Integer scoreIndex = maxScore < totalScore ? maxScore : minScore > totalScore ? minScore : totalScore; | |
| 729 | + List<BabyEvaluationCriterionModel> criterionModel = mongoTemplate.find(Query.query(Criteria.where("score").gte(scoreIndex).and("month").is(month).and("type").is(1)). | |
| 730 | + with(new Sort(new Sort.Order(Sort.Direction.ASC, "minScore")) ), BabyEvaluationCriterionModel.class); | |
| 731 | + return criterionModel.get(0); | |
| 703 | 732 | } |
| 704 | 733 | |
| 705 | 734 | /** |