Commit e1e48aa17b5bfa951e5d69211aa6691efd91cb18
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 1 changed file
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
e1e48aa
| ... | ... | @@ -26,6 +26,8 @@ |
| 26 | 26 | import com.lyms.platform.permission.service.OrganizationService; |
| 27 | 27 | import com.lyms.platform.pojo.*; |
| 28 | 28 | import com.lyms.platform.query.*; |
| 29 | +import com.mongodb.BasicDBObject; | |
| 30 | +import com.mongodb.DBObject; | |
| 29 | 31 | import org.apache.commons.collections.CollectionUtils; |
| 30 | 32 | import org.apache.commons.collections.MapUtils; |
| 31 | 33 | import org.apache.commons.dbutils.DbUtils; |
| ... | ... | @@ -34,6 +36,7 @@ |
| 34 | 36 | import org.apache.commons.lang.StringUtils; |
| 35 | 37 | import org.springframework.beans.factory.annotation.Autowired; |
| 36 | 38 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 39 | +import org.springframework.data.mongodb.core.query.BasicQuery; | |
| 37 | 40 | import org.springframework.data.mongodb.core.query.Criteria; |
| 38 | 41 | import org.springframework.data.mongodb.core.query.Query; |
| 39 | 42 | import org.springframework.stereotype.Component; |
| ... | ... | @@ -87,7 +90,7 @@ |
| 87 | 90 | |
| 88 | 91 | private static String[] blood_item = new String[]{"--","--","--","--","--","--","--","--","--"}; |
| 89 | 92 | |
| 90 | - private static final Integer MAX_TODAY_COUNT = 5; | |
| 93 | + private static Integer MAX_TODAY_COUNT = 5; | |
| 91 | 94 | |
| 92 | 95 | public BaseListResponse queryMeasureInfoList(String queryNo, |
| 93 | 96 | Integer valueType, String vcCardNo, |
| ... | ... | @@ -637,6 +640,7 @@ |
| 637 | 640 | { |
| 638 | 641 | measureMap.put("weight",dataInfoModel.getValueOne()); |
| 639 | 642 | measureMap.put("height",dataInfoModel.getValueTwo()); |
| 643 | + measureMap.put("beforeWeight",dataInfoModel.getValueThree()); | |
| 640 | 644 | } |
| 641 | 645 | else if (dataInfoModel.getValueType() != null && dataInfoModel.getValueType() == 2) |
| 642 | 646 | { |
| 643 | 647 | |
| ... | ... | @@ -859,11 +863,35 @@ |
| 859 | 863 | m.put("nowWeight", currentWeight); |
| 860 | 864 | dayWeights2.add(m); |
| 861 | 865 | patientWeight.setDayWeights2(dayWeights2); |
| 862 | - | |
| 863 | 866 | patientWeight.setModified(new Date()); |
| 864 | 867 | patientWeightService2.add(patientWeight); |
| 865 | 868 | |
| 866 | 869 | } |
| 870 | + | |
| 871 | + MeasureInfoRequest measureInfoRequest = new MeasureInfoRequest(); | |
| 872 | + measureInfoRequest.setCertNo(patients.getCardNo()); | |
| 873 | + measureInfoRequest.setCertType(patients.getPcerteTypeId()); | |
| 874 | + measureInfoRequest.setVcCardNo(patients.getVcCardNo()); | |
| 875 | + measureInfoRequest.setHospitalId(hospitalId); | |
| 876 | + measureInfoRequest.setPhone(patients.getPhone()); | |
| 877 | + measureInfoRequest.setSex(0); | |
| 878 | + measureInfoRequest.setUserName(patients.getUsername()); | |
| 879 | + measureInfoRequest.setAge(DateUtil.getAge(patients.getBirth()) + ""); | |
| 880 | + addMeasureUserInfo(measureInfoRequest); | |
| 881 | + | |
| 882 | + | |
| 883 | + MeasureInfoRequest request = new MeasureInfoRequest(); | |
| 884 | + request.setCertNo(patients.getCardNo()); | |
| 885 | + request.setCertType(patients.getPcerteTypeId()); | |
| 886 | + request.setHospitalId(hospitalId); | |
| 887 | + request.setValueType(1);//体重和身高 | |
| 888 | + request.setValueOne(currentWeight); | |
| 889 | + request.setValueTwo(nutritionInfoRequest.getBeforeHeight() == null ? patientWeights.get(0).getBeforeHeight() : nutritionInfoRequest.getBeforeHeight()); | |
| 890 | + request.setValueThree(nutritionInfoRequest.getBeforeWeight() == null ? patientWeights.get(0).getBeforeWeight() : nutritionInfoRequest.getBeforeWeight()); | |
| 891 | + | |
| 892 | + addToDataInfo(request); | |
| 893 | + | |
| 894 | + | |
| 867 | 895 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
| 868 | 896 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 869 | 897 | objectResponse.setErrormsg("成功"); |
| 870 | 898 | |
| ... | ... | @@ -935,9 +963,34 @@ |
| 935 | 963 | bloodPressure.setPid(bp.getPid()); |
| 936 | 964 | bloodPressureService.update(bloodPressure); |
| 937 | 965 | } |
| 966 | + | |
| 967 | + MeasureInfoRequest measureInfoRequest = new MeasureInfoRequest(); | |
| 968 | + measureInfoRequest.setCertNo(p.getCardNo()); | |
| 969 | + measureInfoRequest.setCertType(p.getPcerteTypeId()); | |
| 970 | + measureInfoRequest.setVcCardNo(p.getVcCardNo()); | |
| 971 | + measureInfoRequest.setHospitalId(hospitalId); | |
| 972 | + measureInfoRequest.setPhone(p.getPhone()); | |
| 973 | + measureInfoRequest.setSex(0); | |
| 974 | + measureInfoRequest.setUserName(p.getUsername()); | |
| 975 | + measureInfoRequest.setAge(DateUtil.getAge(p.getBirth())+""); | |
| 976 | + addMeasureUserInfo(measureInfoRequest); | |
| 977 | + | |
| 978 | + MeasureInfoRequest request = new MeasureInfoRequest(); | |
| 979 | + | |
| 980 | + request.setCertNo(p.getCardNo()); | |
| 981 | + request.setCertType(p.getPcerteTypeId()); | |
| 982 | + request.setHospitalId(hospitalId); | |
| 983 | + request.setValueType(2);//血压和脉搏 | |
| 984 | + request.setValueOne(nutritionInfoRequest.getPulse()+""); | |
| 985 | + request.setValueTwo(nutritionInfoRequest.getSsy()+"/"+nutritionInfoRequest.getSzy()); | |
| 986 | + | |
| 987 | + addToDataInfo(request); | |
| 988 | + | |
| 938 | 989 | return RespBuilder.buildSuccess(); |
| 939 | 990 | } |
| 940 | 991 | |
| 992 | + | |
| 993 | + | |
| 941 | 994 | public BaseObjectResponse getFacePairMatching(NutritionInfoRequest request) { |
| 942 | 995 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
| 943 | 996 | |
| ... | ... | @@ -969,6 +1022,16 @@ |
| 969 | 1022 | objectResponse.setErrorcode(ErrorCodeConstants.NO_DATA); |
| 970 | 1023 | objectResponse.setErrormsg("匹配失败"); |
| 971 | 1024 | return objectResponse; |
| 1025 | + } | |
| 1026 | + | |
| 1027 | + /** | |
| 1028 | + * 添加测量数据到 | |
| 1029 | + * @param measureInfoRequest | |
| 1030 | + * @return | |
| 1031 | + */ | |
| 1032 | + public BaseResponse addToDataInfo(MeasureInfoRequest measureInfoRequest) { | |
| 1033 | + MAX_TODAY_COUNT = 100; | |
| 1034 | + return addMeasureDataInfo(measureInfoRequest); | |
| 972 | 1035 | } |
| 973 | 1036 | } |