Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing 2 years ago
parent
commit
116ad8e171

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/admin/AdminListInfoController.java

@ -52,7 +52,7 @@ public class AdminListInfoController extends EnvelopRestEndpoint {
                return ObjEnvelop.getError("该操作没有权限");
            }
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient,null,null));
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient,null,null,null));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java

@ -173,9 +173,11 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
                                                     @ApiParam(name="deviceSn",value = "设备SN",required = false)
                                                     @RequestParam(value = "deviceSn",required = false)String deviceSn,
                                                     @ApiParam(name = "warnTime",value = "预警时间")
                                                     @RequestParam(value = "warnTime",required = false)String warnTime){
                                                     @RequestParam(value = "warnTime",required = false)String warnTime,
                                                     @ApiParam(name="isShow",value = "是否展示综合信息",required = false)
                                                     @RequestParam(value = "isShow",required = false)Integer isShow){
        try {
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient,deviceSn,warnTime));
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient,deviceSn,warnTime,isShow));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }

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

@ -713,7 +713,7 @@ public class PatientInfoPlatFormService {
    /**
     *获取设备详情
     */
    public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime){
    public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime,Integer isShow){
        List<Map<String,Object>>  list = new ArrayList<>();
        String sql = "select dd.photo,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime,dd.device_type as deviceType " +
                "from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code \n" +
@ -733,9 +733,11 @@ public class PatientInfoPlatFormService {
            Map<String,Object> detailInfo =  getDeviceIndexAndOrder(category_code,deviceSN,patient,warnTime);
            tmp.put("detailInfo",detailInfo);
        }
        Map<String,Object> resultMap =  deviceIndexInfo(list);
        list.add(resultMap);
        if (null!=isShow&&1==isShow){
            Map<String,Object> resultMap =  deviceIndexInfo(list);
            list.add(resultMap);
        }
        return list;
    }
@ -761,13 +763,16 @@ public class PatientInfoPlatFormService {
            switch (categoryCode) {
                case 4:
                    deviceOnLineMap.put("deviceName",device_name);
                    if (detailInfo.get("wear_flagName").toString().equals("未佩戴")){
                    boolean wearFlagNameBoolean = detailInfo.containsKey("wear_flagName");
                    if (wearFlagNameBoolean&&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());
                    if (wearFlagNameBoolean) {
                        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","暂无数据?");put("value1",0);}};
@ -780,7 +785,10 @@ public class PatientInfoPlatFormService {
                        oldCheckInfoMap.put("heartStatus",heartRate.get("value1_status"));
                    }
                    oldCheckInfoMap.put("heart",heartRate.get("value1"));
                    oldCheckInfoMap.put("leaveHome",detailInfo.get("homeRange"));
                    if (!detailInfo.get("homeRange").equals("暂无数据?")) {
                        oldCheckInfoMap.put("leaveHome",detailInfo.get("homeRange"));
                    }
                    oldCheckInfoMap.put("address",location.get("address"));
                    if (!detailInfo.get("steps_status").equals("暂无数据?")||!steps.get("steps").equals(0)) {
                        oldCheckInfoMap.put("stepsStatus",detailInfo.get("steps_status"));
@ -874,7 +882,7 @@ public class PatientInfoPlatFormService {
    public List<Map<String, Object>> patientDeviceNameList(String patient){
        String sql = "SELECT dd.category_code,dd.model,pd.device_name,dd.device_type AS deviceType  FROM dm_device dd " +
                " INNER JOIN wlyy_patient_device pd ON dd.category_code = pd.category_code INNER JOIN wlyy_devices wd ON dd.model = wd.device_model " +
                " INNER JOIN wlyy_patient_device pd ON dd.category_code = pd.category_code AND pd.category_code <> '17' INNER JOIN wlyy_devices wd ON dd.model = wd.device_model " +
                " AND pd.device_sn = wd.device_code  WHERE 1 = 1 AND pd.del = 0 AND pd.`user` = '"+patient+"' " +
                " GROUP BY dd.category_code ORDER BY dd.device_type DESC,pd.czrq ASC";
@ -1087,7 +1095,7 @@ public class PatientInfoPlatFormService {
                            }else {
                                detailInfo.put("isAtHome",dict(dictList,"ty4"));
                            }
                            detailInfo.put("homeRange",homeDistance * 1000);
                            detailInfo.put("homeRange",Math.floor(homeDistance * 1000));
                        }else {
                            detailInfo.put("homeRange",zwsj);
                            detailInfo.put("isAtHome",zwsj);