Bläddra i källkod

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

LAPTOP-KB9HII50\70708 2 år sedan
förälder
incheckning
7050948d64

+ 5 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -168,9 +168,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            return result;
        }
        List<WlyyHospitalSysDictDO> list = wlyyHospitalSysDictDao.findByDictName("doctor_level");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:list){
            if (doctors.getLevel().equals(wlyyHospitalSysDictDO.getDictCode())){
                doctors.setLevelName(wlyyHospitalSysDictDO.getDictValue());
        if (null!=doctors.getLevel()){
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:list){
                if (doctors.getLevel().equals(wlyyHospitalSysDictDO.getDictCode())){
                    doctors.setLevelName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
        }
        //医生归属业务模块角色信息,非必填,数据可有可没有

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

@ -2035,10 +2035,15 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
    }
    public com.alibaba.fastjson.JSONObject getSleepDeviceInfo(String deviceSn){
        MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
        param.add("mac", deviceSn);
        HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(AqgConfig.sleepDevice_info, param, HttpMethod.GET, getCookie());
        return response.getBody();
        try {
            MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
            param.add("mac", deviceSn);
            HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(AqgConfig.sleepDevice_info, param, HttpMethod.GET, getCookie());
            return response.getBody();
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
    public com.alibaba.fastjson.JSONObject sleepDeviceEdit(String deviceSn,Integer heart_check_enable,Integer breath_check_enable,Integer offbed_check_enable,

+ 2 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/BaseServiceNewsService.java

@ -64,7 +64,8 @@ public class BaseServiceNewsService {
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " and code not in ('"+orgCodes+"')";
        }
        String sql = "SELECT code,name,brief,address,photo,mobile,longitude,latitude,type from base_org WHERE type in ('3','4') and del =1";
        String sql = "SELECT code,name,brief,address,photo,mobile,longitude,latitude,type from base_org WHERE type in ('3','4','6') and del =1 " +
                " and code not in ('zdjsylfwyxgszhfgs') ";
        sql += filter;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;

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

@ -2102,78 +2102,83 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        } else {
            DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
            JSONObject deviceInfo = patientDeviceService.getSleepDeviceInfo(deviceDo.getDeviceSn());
            if (deviceInfo.getBooleanValue("success")) {
                result.put("patientAddress", deviceDo.getSosAddress());
                JSONArray objInfo = deviceInfo.getJSONArray("objs");
                if (objInfo.size() > 0) {
                    result.put("sleepStatus", true);
                    JSONObject tmp = objInfo.getJSONObject(0);
                    JSONObject sleepInfo = new JSONObject();
                    if (StringUtils.isBlank(dayTime)) {
                        dayTime = getSleepMonitoringDay(new Date(), patient);
                    }
                    List<BaseSleepPlanDetail> planDetails = sleepPlanDetailDao.findByPatientAndDay(patient, dayTime);
                    BaseSleepPlanDetail planDetail = new BaseSleepPlanDetail();
                    if (planDetails.size() > 0) {
                        planDetail = planDetails.get(0);
                        List<BaseSleepNightRecord> sleepNightRecordList = nightRecordDao.findByPatientAndDayOrderByCreateTimeDesc(patient, dayTime);
                        planDetail.setSleepNightRecordList(sleepNightRecordList);
                    }
                    String jsonStr = JSON.toJSONStringWithDateFormat(planDetail, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
                    sleepInfo = JSONObject.parseObject(jsonStr);
                    sleepInfo.put("day", dayTime);
                    List<BaseSleepPlan> sleepPlans = sleepPlanDao.findByPatient(patient);
                    if (sleepPlans.size() > 0) {
                        BaseSleepPlan sleepPlan = sleepPlans.get(0);
                        String endTime = DateUtil.getNextMin(sleepPlan.getGetUpTime(), -1);
                        sleepInfo.put("sleepPlan", true);
                        sleepInfo.put("getUpTime", sleepPlan.getGetUpTime());
                        sleepInfo.put("siestaTime", sleepPlan.getNapTime());
                        sleepInfo.put("nightRestTime", sleepPlan.getNightRestTime());
                        sleepInfo.put("nightRecordTime", sleepPlan.getNightRestTime() + "-隔日" + endTime);
                    } else {
                        sleepInfo.put("sleepPlan", false);
                    }
                    sleepInfo.put("online", tmp.getBooleanValue("online"));
                    if(tmp.getBooleanValue("online")){
                        sleepInfo.put("contactStatus", 1);
                    }
                    else {
                        sleepInfo.put("contactStatus", 0);
                    }
            if (null!=deviceInfo){
                if (deviceInfo.getBooleanValue("success")) {
                    result.put("patientAddress", deviceDo.getSosAddress());
                    JSONArray objInfo = deviceInfo.getJSONArray("objs");
                    if (objInfo.size() > 0) {
                        result.put("sleepStatus", true);
                        JSONObject tmp = objInfo.getJSONObject(0);
                        JSONObject sleepInfo = new JSONObject();
                        if (StringUtils.isBlank(dayTime)) {
                            dayTime = getSleepMonitoringDay(new Date(), patient);
                        }
                        List<BaseSleepPlanDetail> planDetails = sleepPlanDetailDao.findByPatientAndDay(patient, dayTime);
                        BaseSleepPlanDetail planDetail = new BaseSleepPlanDetail();
                        if (planDetails.size() > 0) {
                            planDetail = planDetails.get(0);
                            List<BaseSleepNightRecord> sleepNightRecordList = nightRecordDao.findByPatientAndDayOrderByCreateTimeDesc(patient, dayTime);
                            planDetail.setSleepNightRecordList(sleepNightRecordList);
                        }
                        String jsonStr = JSON.toJSONStringWithDateFormat(planDetail, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
                        sleepInfo = JSONObject.parseObject(jsonStr);
                        sleepInfo.put("day", dayTime);
                        List<BaseSleepPlan> sleepPlans = sleepPlanDao.findByPatient(patient);
                        if (sleepPlans.size() > 0) {
                            BaseSleepPlan sleepPlan = sleepPlans.get(0);
                            String endTime = DateUtil.getNextMin(sleepPlan.getGetUpTime(), -1);
                            sleepInfo.put("sleepPlan", true);
                            sleepInfo.put("getUpTime", sleepPlan.getGetUpTime());
                            sleepInfo.put("siestaTime", sleepPlan.getNapTime());
                            sleepInfo.put("nightRestTime", sleepPlan.getNightRestTime());
                            sleepInfo.put("nightRecordTime", sleepPlan.getNightRestTime() + "-隔日" + endTime);
                        } else {
                            sleepInfo.put("sleepPlan", false);
                        }
                        sleepInfo.put("online", tmp.getBooleanValue("online"));
                        if(tmp.getBooleanValue("online")){
                            sleepInfo.put("contactStatus", 1);
                        }
                        else {
                            sleepInfo.put("contactStatus", 0);
                        }
                    if (tmp.getBooleanValue("onbed")) {
                        sleepInfo.put("bedStatus", 1);
                        sleepInfo.put("heartRate", tmp.getString("heartrate"));
                        sleepInfo.put("breath", tmp.getString("breathrate"));
                    } else {
                        sleepInfo.put("bedStatus", 0);
                        sleepInfo.put("heartRate", null);
                        sleepInfo.put("breath", null);
                    }
                    BasePatientOutBed outBed = outBedDao.findByPatientAndDeviceSnAndStatus(patient, deviceDo.getDeviceSn(), 0);
                    if (null != outBed) {
                        String outBedTime = "";
                        Date date = new Date();
                        long millisecondsDiff = date.getTime() - outBed.getCreateTime().getTime();
                        long minutesDiff = millisecondsDiff / TimeUnit.MINUTES.toMillis(1L);
                        long hoursDiff = millisecondsDiff / TimeUnit.HOURS.toMillis(1L);
                        long minuteFieldDiff = minutesDiff - TimeUnit.HOURS.toMinutes(hoursDiff);
                        if (hoursDiff > 0L) {
                            outBedTime += String.format("%d小时", hoursDiff);
                        if (tmp.getBooleanValue("onbed")) {
                            sleepInfo.put("bedStatus", 1);
                            sleepInfo.put("heartRate", tmp.getString("heartrate"));
                            sleepInfo.put("breath", tmp.getString("breathrate"));
                        } else {
                            sleepInfo.put("bedStatus", 0);
                            sleepInfo.put("heartRate", null);
                            sleepInfo.put("breath", null);
                        }
                        if (minuteFieldDiff > 0) {
                            outBedTime += String.format("%d分钟", minuteFieldDiff);
                        BasePatientOutBed outBed = outBedDao.findByPatientAndDeviceSnAndStatus(patient, deviceDo.getDeviceSn(), 0);
                        if (null != outBed) {
                            String outBedTime = "";
                            Date date = new Date();
                            long millisecondsDiff = date.getTime() - outBed.getCreateTime().getTime();
                            long minutesDiff = millisecondsDiff / TimeUnit.MINUTES.toMillis(1L);
                            long hoursDiff = millisecondsDiff / TimeUnit.HOURS.toMillis(1L);
                            long minuteFieldDiff = minutesDiff - TimeUnit.HOURS.toMinutes(hoursDiff);
                            if (hoursDiff > 0L) {
                                outBedTime += String.format("%d小时", hoursDiff);
                            }
                            if (minuteFieldDiff > 0) {
                                outBedTime += String.format("%d分钟", minuteFieldDiff);
                            }
                            sleepInfo.put("outBedTimeCrzq", outBed.getCreateTime());
                            sleepInfo.put("outBedTime", outBedTime);
                        } else {
                            sleepInfo.put("outBedTime", "无");
                        }
                        sleepInfo.put("outBedTimeCrzq", outBed.getCreateTime());
                        sleepInfo.put("outBedTime", outBedTime);
                    } else {
                        sleepInfo.put("outBedTime", "无");
                        result.put("sleepInfo", sleepInfo);
                    }
                    result.put("sleepInfo", sleepInfo);
                } else {
                    result.put("sleepStatus", false);
                    result.put("sleepInfo", "获取睡眠带数据失败");
                }
            } else {
            }else {
                result.put("sleepStatus", false);
                result.put("sleepInfo", "获取睡眠带数据失败");
            }

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -330,7 +330,7 @@ public class StatisticsService {
        JSONObject res = new JSONObject();
        String medicalInstitutionSql = "SELECT COUNT(1) FROM base_org WHERE (type = 1 OR type = 2) AND del = 1 " + orgFilter;
        String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1" + orgFilter;
        String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1 and code not in ('zdjsylfwyxgszhfgs') " + orgFilter;
        String childcareInstitutionsssSql = "SELECT COUNT(1) FROM base_org WHERE type = 4 AND del = 1" + orgFilter;
        String careCenterNumSql = "SELECT COUNT(1) FROM base_org WHERE type = 6 AND del = 1" + orgFilter;

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

@ -777,19 +777,25 @@ public class PatientInfoPlatFormService {
                }
                JSONObject response = patientDeviceService.getAqgDeviceInfo2(deviceSn);
                //手表佩戴状态
                if (response.containsKey("wear_flag") && response.get("wear_flag") != null) {
                    detailInfo.put("wear_flag", response.get("wear_flag"));
                    detailInfo.put("wear_flagName", 1==response.getInteger("wear_flag")?"未佩戴":"已佩戴");
                }
                //电量
                if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
                    detailInfo.put("remaining_power", response.get("remaining_power"));
                }
                //在线状态实时获取
                if (!response.getBoolean("online")) {//设备在线状态
                    detailInfo.put("contact_status",0);
                } else {
                    detailInfo.put("contact_status",1);
                if (null!=response){
                    if (response.containsKey("wear_flag") && response.get("wear_flag") != null) {
                        detailInfo.put("wear_flag", response.get("wear_flag"));
                        detailInfo.put("wear_flagName", 1==response.getInteger("wear_flag")?"未佩戴":"已佩戴");
                    }
                    //电量
                    if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
                        detailInfo.put("remaining_power", response.get("remaining_power"));
                    }
                    //在线状态实时获取
                    if (!response.getBoolean("online")) {//设备在线状态
                        detailInfo.put("contact_status",0);
                    } else {
                        detailInfo.put("contact_status",1);
                    }
                }else {
                    detailInfo.put("wear_flag",null);
                    detailInfo.put("wear_flagName", null);
                    detailInfo.put("remaining_power",null);
                }
                sql = "select *,CAST(DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') as char) create_time from base_patient_step where 1=1  and device_sn='"+deviceSn+"' order by create_time desc limit 1";
                sqlResult = jdbcTemplate.queryForList(sql);
@ -838,15 +844,17 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                }
                response = patientDeviceService.getAqgDeviceInfo2(deviceSn);
                //电量
                if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
                    detailInfo.put("remaining_power", response.get("remaining_power"));
                }
                //在线状态实时获取
                if (!response.getBoolean("online")) {//设备在线状态
                    detailInfo.put("contact_status",0);
                } else {
                    detailInfo.put("contact_status",1);
                if (null!=response){
                    //电量
                    if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
                        detailInfo.put("remaining_power", response.get("remaining_power"));
                    }
                    //在线状态实时获取
                    if (!response.getBoolean("online")) {//设备在线状态
                        detailInfo.put("contact_status",0);
                    } else {
                        detailInfo.put("contact_status",1);
                    }
                }
                break;
            case "12"://监控
@ -884,23 +892,25 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                }
                JSONObject deviceInfo = patientDeviceService.getSleepDeviceInfo(deviceSn);
                if (deviceInfo.getBooleanValue("success")) {
                    com.alibaba.fastjson.JSONArray objInfo = deviceInfo.getJSONArray("objs");
                    if (objInfo.size() > 0) {
                        response = objInfo.getJSONObject(0);
                        if (!response.getBoolean("online")) {//设备在线状态
                            detailInfo.put("contact_status",0);
                        } else {
                            detailInfo.put("contact_status",1);
                        }
                        if (response.getBooleanValue("onbed")) {//当前在床状态
                            detailInfo.put("bedStatus", 1);
                            detailInfo.put("heartRate", response.getString("heartrate"));
                            detailInfo.put("breath", response.getString("breathrate"));
                        } else {
                            detailInfo.put("bedStatus", 0);
                            detailInfo.put("heartRate", null);
                            detailInfo.put("breath", null);
                if (null!=deviceInfo){
                    if (deviceInfo.getBooleanValue("success")) {
                        com.alibaba.fastjson.JSONArray objInfo = deviceInfo.getJSONArray("objs");
                        if (objInfo.size() > 0) {
                            response = objInfo.getJSONObject(0);
                            if (!response.getBoolean("online")) {//设备在线状态
                                detailInfo.put("contact_status",0);
                            } else {
                                detailInfo.put("contact_status",1);
                            }
                            if (response.getBooleanValue("onbed")) {//当前在床状态
                                detailInfo.put("bedStatus", 1);
                                detailInfo.put("heartRate", response.getString("heartrate"));
                                detailInfo.put("breath", response.getString("breathrate"));
                            } else {
                                detailInfo.put("bedStatus", 0);
                                detailInfo.put("heartRate", null);
                                detailInfo.put("breath", null);
                            }
                        }
                    }
                }