浏览代码

Merge branch 'dev' of chinawu123/wlyy2.0 into dev

chinawu123 2 年之前
父节点
当前提交
fc99974fa6

+ 59 - 20
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -761,34 +761,53 @@ public class PatientInfoPlatFormService {
            switch (categoryCode) {
                case 4:
                    deviceOnLineMap.put("deviceName",device_name);
                    if (detailInfo.get("wear_flagName").toString().equals("未佩戴"))deviceStatus +=1;
                    if (detailInfo.get("wear_flagName").toString().equals("未佩戴")){
                        deviceStatus +=1;
                        deviceOnLineMap.put("deviceStatusCode",2);
                    }else {
                        deviceOnLineMap.put("deviceStatusCode",0);
                    }
                    deviceOnLineMap.put("deviceStatus",detailInfo.get("wear_flagName").toString());
                    //Map heartRate = detailInfo.get("heartRate").equals("暂无数据?")?(Map) detailInfo.get("heartRate"):new HashMap<>();
                   Map<String,Object> heartRate = !detailInfo.get("heartRate").equals("暂无数据?")?(Map) detailInfo.get("heartRate"): (Map)new HashMap(){{put("value1_status","暂无数据?");}};
                   Map<String,Object> heartRate = !detailInfo.get("heartRate").equals("暂无数据?")?(Map) detailInfo.get("heartRate"): (Map)new HashMap(){{put("value1_status","暂无数据?");put("value1",0);}};
                    Map location = detailInfo.get("location")!=null?(Map) detailInfo.get("location"):new HashMap<>();
                    Map steps = (Map) detailInfo.get("steps");
                    Map steps = !detailInfo.get("steps").equals(0)?(Map)detailInfo.get("steps"):new HashMap(){{put("steps",0);}};
                    if (!heartRate.get("value1_status").equals("正常")) oldIndex+=1;
                    oldCheckInfoMap.put("heartStatus",heartRate.get("value1_status"));
                    oldCheckInfoMap.put("heart",heartRate.get("value1"));
                    oldCheckInfoMap.put("leaveHome",detailInfo.get("homeRange"));
                    oldCheckInfoMap.put("address",location.get("address"));
                    oldCheckInfoMap.put("stepsStatus",detailInfo.get("steps_status"));
                    oldCheckInfoMap.put("steps",steps.get("steps"));
                    if (!detailInfo.get("steps_status").equals("暂无数据?")||!steps.get("steps").equals(0)) {
                        oldCheckInfoMap.put("stepsStatus",detailInfo.get("steps_status"));
                        oldCheckInfoMap.put("steps",steps.get("steps"));
                    }
                    break;
                case 12:
                    deviceOnLineMap.put("deviceName",device_name);
                    deviceOnLineMap.put("deviceStatus",online);
                    if (online.equals("离线")) deviceStatus+=1;
                    if (online.equals("离线")){
                        deviceStatus+=1;
                        deviceOnLineMap.put("deviceStatusCode",1);
                    }else {
                        deviceOnLineMap.put("deviceStatusCode",0);
                    }
                    //deviceOnLineMap.put("deviceStatus",detailInfo.get("warnStatus").toString().equals("true")?"正常":"异常");
                    break;
                case 13:
                    if (online.equals("离线")) deviceStatus+=1;
                    if (online.equals("离线")) {
                        deviceStatus+=1;
                        deviceOnLineMap.put("deviceStatusCode",1);
                    }else {
                        deviceOnLineMap.put("deviceStatusCode",0);
                    }
                    deviceOnLineMap.put("deviceName",device_name);
                    deviceOnLineMap.put("deviceStatus",online);
                    if (!detailInfo.get("breath_status").equals("正常"))oldIndex+=1;
                    oldCheckInfoMap.put("breathStatus",detailInfo.get("breath_status"));
                    oldCheckInfoMap.put("breath",detailInfo.get("breath"));
                    oldCheckInfoMap.put("bedStatus",detailInfo.get("bedStatus"));
                    break;
                case 14:
@ -797,18 +816,30 @@ public class PatientInfoPlatFormService {
                    if (!detailInfo.get("warnStatus").equals("异常"))oldIndex+=1;
                    oldCheckInfoMap.put("qgValueStatus",detailInfo.get("warnStatus"));
                    oldCheckInfoMap.put("qgValue",detailInfo.get("value"));
                    if (online.equals("离线")) deviceStatus+=1;
                    if (online.equals("离线")){
                        deviceStatus+=1;
                        deviceOnLineMap.put("deviceStatusCode",1);
                    }else {
                        deviceOnLineMap.put("deviceStatusCode",0);
                    }
                    break;
                case 15:
                    deviceOnLineMap.put("deviceName",device_name);
                    deviceOnLineMap.put("deviceStatus",online);
                    if (online.equals("离线")) deviceStatus+=1;
                    if (online.equals("离线")) {
                        deviceStatus+=1;
                        deviceOnLineMap.put("deviceStatusCode",1);
                    }else {
                        deviceOnLineMap.put("deviceStatusCode",0);
                    }
                    if (!detailInfo.get("value1_Status").equals("异常"))oldIndex+=1;
                    oldCheckInfoMap.put("ygValueStatus",detailInfo.get("value1_Status"));
                    oldCheckInfoMap.put("ygValue",detailInfo.get("value"));
                    if (!detailInfo.get("temperature_status").equals("异常"))oldIndex+=1;
                    oldCheckInfoMap.put("temperatureStatus",detailInfo.get("temperature_status"));
                    oldCheckInfoMap.put("temperatureValue",detailInfo.get("temperature_value"));
                    if (!detailInfo.get("temperature_status").equals("暂无数据?")) {
                        oldCheckInfoMap.put("temperatureStatus",detailInfo.get("temperature_status"));
                        oldCheckInfoMap.put("temperatureValue",detailInfo.get("temperature_value"));
                    }
                    break;
            }
@ -826,6 +857,8 @@ public class PatientInfoPlatFormService {
            resultMap.put("synthesisProposal",dict(dictList,"device_index2"));
        }else if (deviceStatus==0&&oldIndex==0){
            resultMap.put("synthesisProposal",dict(dictList,"device_index1"));
        }else {
            resultMap.put("synthesisProposal","待分析!");
        }
        resultMap.put("deviceRunInfo",deviceOnLineList);
        resultMap.put("oldCheck",oldCheckInfoList);
@ -1009,12 +1042,13 @@ public class PatientInfoPlatFormService {
                sqlResult = jdbcTemplate.queryForList(sql+pageSql);
                if (sqlResult.size()>0){
                    Integer xl = Integer.parseInt(sqlResult.get(0).get("value1").toString());
                    if (xl>=50&&xl<=100) {
                    Integer xlValue1 = Integer.parseInt(dict(dictList,"xlValue1"));
                    Integer xlValue2 = Integer.parseInt(dict(dictList,"xlValue1"));
                    if (xl>=xlValue1&&xl<=xlValue2) {
                        dictCode= "zc1";
                    }else if (xl<50){
                    }else if (xl<xlValue1){
                        dictCode="xl2";
                    }else if (xl>100){
                    }else if (xl>xlValue2){
                        dictCode="xl3";
                    }
                    sqlResult.get(0).put("value1_status",dict(dictList,dictCode));
@ -1153,6 +1187,8 @@ public class PatientInfoPlatFormService {
                                detailInfo.put("bedStatus", dict(dictList,"yachuang1"));
                                Integer heartRate = response.getInteger("heartrate");
                                Integer breath = response.getInteger("breathrate");
                                Integer xlValue1 = Integer.parseInt(dict(dictList,"xlValue1"));
                                Integer xlValue2 = Integer.parseInt(dict(dictList,"xlValue1"));
                                dictCode = "";
                                if (heartRate > 100) {
                                    dictCode = "xl3";
@ -1165,11 +1201,14 @@ public class PatientInfoPlatFormService {
                                detailInfo.put("heartRate", heartRate);
                                detailInfo.put("breath", breath);
                                detailInfo.put("heartRate_status",dict(dictList,dictCode));
                                if (breath > 20) {
                                Integer hxValue1 = Integer.parseInt(dict(dictList,"hxValue1"));
                                Integer hxValue2 = Integer.parseInt(dict(dictList,"hxValue2"));
                                if (breath > hxValue2) {
                                    dictCode = "hx1";
                                } else if (breath < 10) {
                                } else if (hxValue1 < 10) {
                                    dictCode = "hx2";
                                } else if (breath >= 10 && breath <= 20) {
                                } else if (breath >= hxValue1 && breath <= hxValue2) {
                                    dictCode = "zc1";
                                }
                                detailInfo.put("breath_status",dict(dictList,dictCode));
@ -1243,7 +1282,7 @@ public class PatientInfoPlatFormService {
                sqlResult = jdbcTemplate.queryForList(sql);
                dictCode ="";
                if (sqlResult.size()>0){
                    if (Integer.parseInt(sqlResult.get(0).get("temperature_value").toString())<50) {
                    if (Integer.parseInt(sqlResult.get(0).get("temperature_value").toString())<Integer.parseInt(dict(dictList,"wdValue1"))) {
                        dictCode = "zc1";
                    }else {
                        dictCode = "yc1";
@ -1302,7 +1341,7 @@ public class PatientInfoPlatFormService {
                        double homeLat = Double.parseDouble(homeLatLon.split(",")[0]);
                        double homeLon = Double.parseDouble(homeLatLon.split(",")[1]);
                        double homeDistance = countDistance.getDistance(homeLat,homeLon,Double.parseDouble(sqlResult.get(0).get("lat").toString()),(Double.parseDouble(sqlResult.get(0).get("lon").toString())));
                        if (homeDistance * 1000 > 50) {
                        if (homeDistance * 1000 > Integer.parseInt(dict(dictList,"ljjjValue1"))) {
                            detailInfo.put("isAtHome","离家");
                        }else {
                            detailInfo.put("isAtHome","居家");