liubing 3 سال پیش
والد
کامیت
c9aa54ca63

+ 6 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java

@ -327,7 +327,7 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
                                @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = false)
                                @RequestParam(value = "topicItem",required = false,defaultValue = "preventLost") String topicItem) {
        try {
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.patientMonitoringInfo(patient,topicItem));
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.patientMonitoringInfo(patient,topicItem,true));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
@ -349,8 +349,10 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "findMonitorPatientsByDoctor")
    @ResponseBody
    public ObjEnvelop findMonitorPatientsByDoctor(@ApiParam(name = "doctor",  required = true)@RequestParam(value = "doctor")String doctor,
                                                  @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = true)
                                                  @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典,actionTrack行动轨迹", required = true)
                                                  @RequestParam(value = "topicItem",required = true,defaultValue = "preventLost") String topicItem,
                                                  @ApiParam(name = "day", value = "day", required = false)
                                                  @RequestParam(value = "day",required = false) String day,
                                                  @ApiParam(name = "page")
                                                  @RequestParam(value = "page",required = false) Integer page,
                                                  @ApiParam(name = "pageSize")
@ -358,7 +360,7 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
                                                  @ApiParam(name = "detail", value = "是否返回专题详情0否 1是")
                                                  @RequestParam(value = "detail",required = false,defaultValue = "0") Integer detail) {
        try {
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.findMonitorPatientsByDoctor(doctor,topicItem,page,pageSize,detail));
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.findMonitorPatientsByDoctor(doctor,topicItem,day,page,pageSize,detail));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
@ -372,7 +374,7 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
                                            @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = false)
                                            @RequestParam(value = "topicItem") String topicItem) {
        try {
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.patientSignTopicInfo(null,patient,topicItem,null));
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.patientSignTopicInfo(null,patient,topicItem,null,true));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }

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

@ -225,7 +225,7 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
                                     @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = false)
                                     @RequestParam(value = "topicItem",required = false) String topicItem){
        try {
            return baseController.write (200,"查询成功","data",securityMonitoringOrderService.patientMonitoringInfo(patient,topicItem));
            return baseController.write (200,"查询成功","data",securityMonitoringOrderService.patientMonitoringInfo(patient,topicItem,true));
        }catch (Exception e){
            return baseController.errorResult(e);
        }

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -1057,7 +1057,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
                    if (StringUtils.isBlank(day)) {
                        day = DateUtil.getStringDateShort();
                    }
                    devInfoObj = securityMonitoringOrderService.patientSignTopicInfo(devInfoObj, patient, "preventLost",deviceSn);
                    devInfoObj = securityMonitoringOrderService.patientSignTopicInfo(devInfoObj, patient, "preventLost",deviceSn,true);
                    //轨迹动态
                    JSONArray locations = getX1Locations(deviceSn, day.replace("-", ""));
                    devInfoObj.put("routes", locations);

+ 41 - 19
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -456,7 +456,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                }else {
                    monitorInfo.put("sleepPlan",false);
                }
                monitorInfo = patientSignTopicInfo(monitorInfo,orderDO.getPatient(),"preventFall",null);
                monitorInfo = patientSignTopicInfo(monitorInfo,orderDO.getPatient(),"preventFall",null,true);
                emergencyOrderVO.setInformation(monitorInfo);
            }catch (Exception e){
                e.printStackTrace();
@ -465,7 +465,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        if (6==orderDO.getOrderSource()){//气感工单
            try {
                JSONObject monitorInfo = JSONObject.parseObject(orderDO.getWarnInfo());
                monitorInfo = patientSignTopicInfo(monitorInfo,orderDO.getPatient(),"preventFall",null);
                monitorInfo = patientSignTopicInfo(monitorInfo,orderDO.getPatient(),"preventFall",null,true);
                emergencyOrderVO.setInformation(monitorInfo);
            }catch (Exception e){
                e.printStackTrace();
@ -474,7 +474,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        if (7==orderDO.getOrderSource()){//烟感工单
            try {
                JSONObject monitorInfo = JSONObject.parseObject(orderDO.getWarnInfo());
                monitorInfo = patientSignTopicInfo(monitorInfo,orderDO.getPatient(),"preventFall",null);
                monitorInfo = patientSignTopicInfo(monitorInfo,orderDO.getPatient(),"preventFall",null,true);
                emergencyOrderVO.setInformation(monitorInfo);
            }catch (Exception e){
                e.printStackTrace();
@ -1398,7 +1398,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        return result;
    }
    public JSONObject patientMonitoringInfo(String patient,String topicItem){
    public JSONObject patientMonitoringInfo(String patient,String topicItem,boolean video){
        JSONObject result = new JSONObject();
        result.put("location",null);
        result.put("fences",null);
@ -1406,7 +1406,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        result.put("fire",null);
        result.put("fall",null);
        result.put("sleep",null);
        result.put("sleepInfo",null);//最近工单
        result.put("sleepOrderInfo",null);//最近工单
        result.put("deviceSn",null);
        result.put("emeAssistance",false);
        result.put("monitorInfo",null);
@ -1448,7 +1448,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                                "and patient='"+patient+"' and `status`=1 order by create_time desc limit 1 ";
                        List<String> serveDesces = jdbcTemplate.queryForList(sql,String.class);
                        if (serveDesces.size()>0){
                            result.put("sleepInfo",serveDesces.get(0));
                            result.put("sleepOrderInfo",serveDesces.get(0));
                        }
                    }else {
                        result.put("sleep",false);
@ -1461,7 +1461,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        if (counnt>0){
            result.put("emeAssistance",true);
        }
        result = patientSignTopicInfo(result,patient,topicItem,null);
        result = patientSignTopicInfo(result,patient,topicItem,null,true);
        return result;
    }
@ -1479,7 +1479,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        result.put("fire",null);
        result.put("fall",null);
        result.put("sleep",null);
        result.put("sleepInfo",null);//最近工单
        result.put("sleepOrderInfo",null);//最近工单
        result.put("deviceSn",null);
        result.put("emeAssistance",false);
        result.put("monitorInfo",null);
@ -1521,7 +1521,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                                "and patient='"+patient+"' and `status`=1 order by create_time desc limit 1 ";
                        List<String> serveDesces = jdbcTemplate.queryForList(sql,String.class);
                        if (serveDesces.size()>0){
                            result.put("sleepInfo",serveDesces.get(0));
                            result.put("sleepOrderInfo",serveDesces.get(0));
                        }
                    }else {
                        result.put("sleep",false);
@ -1536,9 +1536,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        }
        List<DevicePatientDevice> devices4 = patientDeviceDao.findByUserAndCategoryCode(patient,"4");//手表
        if (devices4.size()>0){
            result =  patientSignTopicInfo(result,patient,"preventLost",devices4.get(0).getDeviceSn());
            result =  patientSignTopicInfo(result,patient,"preventLost",devices4.get(0).getDeviceSn(),true);
        }
        patientSignTopicInfo(result,patient,"preventFall",null);
        patientSignTopicInfo(result,patient,"preventFall",null,true);
        return result;
    }
@ -1870,7 +1870,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    }
    public JSONObject patientSignTopicInfo(JSONObject result,String patient,String topicItem,String deviceSn){
    public JSONObject patientSignTopicInfo(JSONObject result,String patient,String topicItem,String deviceSn,boolean video){
        if (null==result){
            result = new JSONObject();
        }
@ -1884,14 +1884,15 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            preventOutOfBed(result, patient,true,null);
        }
        if ("preventFire".equals(topicItem)||StringUtils.isBlank(topicItem)){
            preventFire(result, patient,null,true);
            preventFire(result, patient,null,video);
        }
        if ("preventGasLeakage".equals(topicItem)||StringUtils.isBlank(topicItem)){
            preventGasLeakage(result, patient,true);
            preventGasLeakage(result, patient,video);
        }
        return result;
    }
    public JSONObject updateDoctorLocation(String doctor,String orderId,String doctorAddress,String doctorLat,String doctorLon){
        JSONObject result = new JSONObject();
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
@ -2063,7 +2064,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        }
    }
    public JSONObject findMonitorPatientsByDoctor(String doctor,String topicItem,Integer page,Integer pageSize,Integer detail){
    public JSONObject findMonitorPatientsByDoctor(String doctor,String topicItem,String day,Integer page,Integer pageSize,Integer detail){
        JSONObject result = new JSONObject();
        String sql = " SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " +
@ -2071,9 +2072,21 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " +
                " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " +
                " and m.doctor_code = '"+doctor+"' and m.del = '1' ";
        String filter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
                         " where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('"+topicItem+"',dd.service_topic)) ";
        String filter = "";
        String deviceSn ="";
        if ("actionTrack".equals(topicItem)){//行动轨迹
            filter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
                    " where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('preventLost',dd.service_topic)) ";
            List<String> deviceSns = jdbcTemplate.queryForList("select 1 from wlyy_patient_device pd INNER JOIN dm_device dd " +
                    " on pd.device_id = dd.id where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('preventLost',dd.service_topic)",String.class);
            if (deviceSns.size()>0){
                deviceSn = deviceSns.get(0);
            }
        }
        else{
            filter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
                    " where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('"+topicItem+"',dd.service_topic)) ";
        }
        if ("preventLost".equals(topicItem)){//有绑定围栏的居民
            filter += " and EXISTS (select 1 from wlyy_patient_safe_area sf where sf.patient = p.id and sf.del=1 and sf.manage_status=1) ";
@ -2095,7 +2108,16 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            result.put("currentPage",page+1);
            for (int i=currentIndexFrom;i<list.size()&&i<currentIndexEnd;i++){
                Map<String,Object> patientTmp = list.get(i);
                JSONObject object = patientMonitoringInfo(patientTmp.get("id").toString(),topicItem);
                JSONObject object = new JSONObject();
                switch (topicItem){
                    case "actionTrack":
                        List<Map<String , Object>> actionTracks = getActionTrack(deviceSn,day);
                        object.put("actionTrack",actionTracks);
                        break;
                    default:
                        object = patientMonitoringInfo(patientTmp.get("id").toString(),topicItem,false);
                        break;
                }
                object.put("patientInfo",patientTmp);
                monitorInfos.add(object);
            }

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

@ -283,7 +283,7 @@ public class PatientInfoPlatFormService {
     * @return
     */
    public JSONObject getPatientMonitoringInfo(String patient){
        return securityMonitoringOrderService.patientMonitoringInfo(patient,null);
        return securityMonitoringOrderService.patientMonitoringInfo(patient,null,true);
    }
    /**

+ 3 - 2
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java

@ -455,8 +455,9 @@ public class DeviceService {
                    }
                    dataPushLogUtil.updContactStatus(imei,1,false);
                    healthIndexDao.save(patientHealthIndex);
                    systemMessageDao.save(messageDO);
                    imUtil.sendPatientSystemMessage(messageDO.getReceiver(),JSON.toJSONString(message,SerializerFeature.WriteMapNullValue));
                    //心率不做异常消息推送
//                    systemMessageDao.save(messageDO);
//                    imUtil.sendPatientSystemMessage(messageDO.getReceiver(),JSON.toJSONString(message,SerializerFeature.WriteMapNullValue));
                }
            }