Parcourir la source

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

shikejing il y a 4 ans
Parent
commit
19c161c547

+ 6 - 6
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -928,7 +928,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        try {
        try {
            JSONObject json = new JSONObject();
            JSONObject json = new JSONObject();
            String endDate = getNewDate(date,day);
            String endDate = getNewDate(date,day);
            if (type.equals("hear")){
            if (type.equals("hear") || type.equals("all")){
                //心率
                //心率
                List<Map<String,Object>> hearDo = monitorPlatformService.getHeartByPatient(patient,date,endDate);
                List<Map<String,Object>> hearDo = monitorPlatformService.getHeartByPatient(patient,date,endDate);
                if (hearDo.size() > 0){
                if (hearDo.size() > 0){
@ -937,7 +937,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                    json.put("hear",0);//心率
                    json.put("hear",0);//心率
                }
                }
            }
            }
            if (type.equals("score")){
            if (type.equals("score") || type.equals("all")){
                //健康分  retWeekTime("week");  周的健康分
                //健康分  retWeekTime("week");  周的健康分
                List<Map<String, Object>> scoreDO = monitorPlatformService.getHealthScoreByPatient(patient,date,endDate);
                List<Map<String, Object>> scoreDO = monitorPlatformService.getHealthScoreByPatient(patient,date,endDate);
                if (scoreDO.size() > 0){
                if (scoreDO.size() > 0){
@ -949,7 +949,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                    json.put("total",0); //健康分值总分
                    json.put("total",0); //健康分值总分
                }
                }
            }
            }
            if (type.equals("realtime")){
            if (type.equals("realtime") || type.equals("all")){
                // 实时数据
                // 实时数据
                List<Map<String, Object>> realtimeDateDo = monitorPlatformService.getRealtimeDateByPatient(patient,date);
                List<Map<String, Object>> realtimeDateDo = monitorPlatformService.getRealtimeDateByPatient(patient,date);
                if (realtimeDateDo.size() > 0){
                if (realtimeDateDo.size() > 0){
@ -963,7 +963,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                    json.put("realtimecal",0); //实时卡路里,累积卡路里
                    json.put("realtimecal",0); //实时卡路里,累积卡路里
                }
                }
            }
            }
            if (type.equals("runData")){
            if (type.equals("runData") || type.equals("all")){
                //运动数据  runDate
                //运动数据  runDate
                List<Map<String , Object>> rundateDo = monitorPlatformService.getRundatePatient(patient,date);
                List<Map<String , Object>> rundateDo = monitorPlatformService.getRundatePatient(patient,date);
                if (rundateDo.size() > 0){
                if (rundateDo.size() > 0){
@ -985,7 +985,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                    json.put("runCalories",0); //跑步消耗卡路里
                    json.put("runCalories",0); //跑步消耗卡路里
                }
                }
            }
            }
            if (type.equals("pai")){
            if (type.equals("pai") || type.equals("all")){
                //PAI数据
                //PAI数据
                List<Map<String,Object>> paiDo = monitorPlatformService.getPaiPatient(patient,date);
                List<Map<String,Object>> paiDo = monitorPlatformService.getPaiPatient(patient,date);
                if (paiDo.size() > 0){
                if (paiDo.size() > 0){
@ -997,7 +997,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                    json.put("dailyPai",0); //总距离
                    json.put("dailyPai",0); //总距离
                }
                }
            }
            }
            if (type.equals("sleepData")){
            if (type.equals("sleepData") || type.equals("all")){
                //睡眠数据
                //睡眠数据
                List<Map<String , Object>> sleepDo = monitorPlatformService.getSleepByPatient(patient,date);
                List<Map<String , Object>> sleepDo = monitorPlatformService.getSleepByPatient(patient,date);
                if (sleepDo.size() > 0){
                if (sleepDo.size() > 0){

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -1704,7 +1704,7 @@ public class MonitorPlatformService  {
    public List<Map<String, Object>> getHealthScoreByPatient(String patient,String date,String endDate){
    public List<Map<String, Object>> getHealthScoreByPatient(String patient,String date,String endDate){
        String sql = "SELECT chhs.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_health_score chhs,wlyy.hm_token t\n" +
        String sql = "SELECT chhs.* FROM xmiot.wlyy_copd_huami_device chd,xmiot.wlyy_copd_huami_health_score chhs,wlyy.hm_token t\n" +
                "WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chhs.device_sn and chhs.date < '"+endDate+"' and chhs.date < '"+date+"' ORDER BY export_time DESC ";
                "WHERE t.patient = '"+patient+"' AND t.patient = chd.patient AND chd.device_sn = chhs.device_sn and chhs.date > '"+endDate+"' and chhs.date < '"+date+"' ORDER BY export_time DESC ";
        List<Map<String, Object>> scoreDO = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> scoreDO = jdbcTemplate.queryForList(sql);
        return scoreDO;
        return scoreDO;
    }
    }