Commit ac7f57fddd63a1264cd74570ac83bf37b37dd006
1 parent
5d07c8f220
Exists in
master
and in
6 other branches
营养管理添加到快速测量
Showing 1 changed file with 42 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
ac7f57f
... | ... | @@ -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, |
94 | 97 | |
... | ... | @@ -859,11 +862,23 @@ |
859 | 862 | m.put("nowWeight", currentWeight); |
860 | 863 | dayWeights2.add(m); |
861 | 864 | patientWeight.setDayWeights2(dayWeights2); |
862 | - | |
863 | 865 | patientWeight.setModified(new Date()); |
864 | 866 | patientWeightService2.add(patientWeight); |
865 | 867 | |
866 | 868 | } |
869 | + | |
870 | + MeasureInfoRequest request = new MeasureInfoRequest(); | |
871 | + | |
872 | + request.setCertNo(patients.getCardNo()); | |
873 | + request.setCertType(patients.getPcerteTypeId()); | |
874 | + request.setHospitalId(hospitalId); | |
875 | + request.setValueType(1);//体重和身高 | |
876 | + request.setValueOne(currentWeight); | |
877 | + request.setValueTwo(nutritionInfoRequest.getBeforeHeight()); | |
878 | + | |
879 | + addToDataInfo(request); | |
880 | + | |
881 | + | |
867 | 882 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
868 | 883 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
869 | 884 | objectResponse.setErrormsg("成功"); |
870 | 885 | |
... | ... | @@ -935,9 +950,24 @@ |
935 | 950 | bloodPressure.setPid(bp.getPid()); |
936 | 951 | bloodPressureService.update(bloodPressure); |
937 | 952 | } |
953 | + | |
954 | + | |
955 | + MeasureInfoRequest request = new MeasureInfoRequest(); | |
956 | + | |
957 | + request.setCertNo(p.getCardNo()); | |
958 | + request.setCertType(p.getPcerteTypeId()); | |
959 | + request.setHospitalId(hospitalId); | |
960 | + request.setValueType(2);//血压和脉搏 | |
961 | + request.setValueOne(nutritionInfoRequest.getPulse()+""); | |
962 | + request.setValueTwo(nutritionInfoRequest.getSsy()+"/"+nutritionInfoRequest.getSzy()); | |
963 | + | |
964 | + addToDataInfo(request); | |
965 | + | |
938 | 966 | return RespBuilder.buildSuccess(); |
939 | 967 | } |
940 | 968 | |
969 | + | |
970 | + | |
941 | 971 | public BaseObjectResponse getFacePairMatching(NutritionInfoRequest request) { |
942 | 972 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
943 | 973 | |
... | ... | @@ -969,6 +999,16 @@ |
969 | 999 | objectResponse.setErrorcode(ErrorCodeConstants.NO_DATA); |
970 | 1000 | objectResponse.setErrormsg("匹配失败"); |
971 | 1001 | return objectResponse; |
1002 | + } | |
1003 | + | |
1004 | + /** | |
1005 | + * 添加测量数据到 | |
1006 | + * @param measureInfoRequest | |
1007 | + * @return | |
1008 | + */ | |
1009 | + public BaseResponse addToDataInfo(MeasureInfoRequest measureInfoRequest) { | |
1010 | + MAX_TODAY_COUNT = 100; | |
1011 | + return addMeasureDataInfo(measureInfoRequest); | |
972 | 1012 | } |
973 | 1013 | } |