Преглед изворни кода

体征长传增加积分区分血压和血糖;设备绑定统计

zd_123 пре 7 година
родитељ
комит
f046d07985

+ 7 - 7
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java

@ -617,17 +617,17 @@ public class AsyncService extends BaseService{
                //判断今天是否加过体征积分
                String urlSearch = wlyyService + "healthBank/selectByDate";
                List<NameValuePair> paramsSearch1 = new ArrayList<>();
                paramsSearch1.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\"BP_MEASURE\",\"startTime\":\""+uploadTime+"\",\"endTime\":\""+uploadTime+"\",\"patientId\":\""+patientCode+"\"}"));
                paramsSearch1.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\""+flagStr+"\",\"startTime\":\""+uploadTime+"\",\"endTime\":\""+uploadTime+"\",\"patientId\":\""+patientCode+"\"}"));
                String responseSearch1 = HttpClientUtil.post(urlSearch, paramsSearch1, "UTF-8");
                List<NameValuePair> paramsSearch2 = new ArrayList<>();
               /* List<NameValuePair> paramsSearch2 = new ArrayList<>();
                paramsSearch2.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\"GLU_MEASURE\",\"startTime\":\""+uploadTime+"\",\"endTime\":\""+uploadTime+"\",\"patientId\":\""+patientCode+"\"}"));
                String responseSearch2 = HttpClientUtil.post(urlSearch, paramsSearch2, "UTF-8");
                String responseSearch2 = HttpClientUtil.post(urlSearch, paramsSearch2, "UTF-8");*/
                com.alibaba.fastjson.JSONObject object1 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch1);
                com.alibaba.fastjson.JSONObject object2 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch2);
                if(object1!=null && object2!=null){
                //com.alibaba.fastjson.JSONObject object2 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch2);
                if(object1!=null){
                    com.alibaba.fastjson.JSONObject jsonObject1 = (com.alibaba.fastjson.JSONObject) object1.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    com.alibaba.fastjson.JSONObject jsonObject2 = (com.alibaba.fastjson.JSONObject) object2.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    if (jsonObject1.getJSONArray("creditsDetailDOS").size()==0 && jsonObject2.getJSONArray("creditsDetailDOS").size()==0){
                    //com.alibaba.fastjson.JSONObject jsonObject2 = (com.alibaba.fastjson.JSONObject) object2.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    if (jsonObject1.getJSONArray("creditsDetailDOS").size()==0){
                        dataUoloadCount = false;
                    }
                }

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -427,7 +427,7 @@ public class DeviceService extends BaseService{
                String patientCode = result.getUser();
                Patient patient = patientDao.findByCode(patientCode);
                asyncService.addIntegral(deviceSn,type,userType,patientCode,deviceType);
                asyncService.addIntegral(deviceSn,type,userType,patientCode,deviceType,uploadTime);
                //血糖、血压数据需校验,如果超标,需要发送消息给医生
	            if (1 == deviceType || 2 == deviceType) {
                    asyncService.verifyHealthIndex(result);

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -6353,12 +6353,11 @@ public class StatisticsESService {
                sql +=" AND d.grant_admin_team IN(SELECT id FROM wlyy_admin_team WHERE available = 1)";
            }
            sqlList = jdbcTemplate.queryForList(sql);
            esModelList = getDeviceBindToTeam(sqlList);
        }else {
            esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(year+"-07-01",date, area, level, index, SaveModel.timeLevel_ZL, low_level);
            esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, low_level);
        }
        esModelList = getDeviceBindToTeam(sqlList);
        //到绑定人的封装数据
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {

+ 12 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -519,10 +519,13 @@ public class EsStatisticsController extends BaseController {
                    }
                    //20指标一个键绑定一条数据 2018年开始所以改用86指标. 2018-08-27 zd
                    String thisYear = Constant.getNowYearByDate(endDate);
                    JSONObject json = new JSONObject();
                    if ("20".equals(idx) && Integer.valueOf(thisYear)>=2018){
                        idx="86";
                        //@TODO idx="86";1.5.0版本返回前端改为index_86
                        json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, "86", lowCode, year,SaveModel.timeLevel_DDL);
                    }else {
                        json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year,SaveModel.timeLevel_DDL);
                    }
                    JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year,SaveModel.timeLevel_DDL);
                    result.put("index_" + idx, json);
                }
            }
@ -598,7 +601,8 @@ public class EsStatisticsController extends BaseController {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalOnlineTeamLeader(date, area, level, idx, sort, lowLevel, year, ""));
                    }else if (idx.equals("20") && Integer.valueOf(year)>=2018){
                        //20指标是一个键绑定一条数据 所以2018年开始使用86指标 2018-08-27 zd
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level, "86", sort, lowLevel, year));
                        //@TODO idx="86";
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level,"86", sort, lowLevel, year));
                    }else {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel, year));
                    }
@ -665,10 +669,13 @@ public class EsStatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                Long total= 0L;
                if ("20".equals(idx) && Integer.valueOf(year)>=2018){
                    idx = "86";
                    //@TODO idx = "86",1.5.0版本改成返回前端改成index_86;
                    total = statisticsESService.getIndexTotal(endDate, area, level, "86", "2");
                }else {
                    total = statisticsESService.getIndexTotal(endDate, area, level, idx, "2");
                }
                Long total=statisticsESService.getIndexTotal(endDate, area, level, idx, "2");
                result.put("index_" + idx, total);
            }