| 
					
				 | 
			
			
				@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.dao.device.PatientDeviceDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.patient.CarePatientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.util.CommonUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.util.ConstantUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.vo.NumVo; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -91,6 +92,8 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String esIndex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${es.type.Statistics}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String esType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private CarePatientService carePatientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private static final String defalutArea = "330100"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -652,6 +655,10 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderOn = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderWxOn = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderPadOn = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderFamilyTotal = 0;//老人家属 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderFamilyOn = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderFamilyOff = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer olderFamilyBinding = 0;//家属绑定老人数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //儿童注册人数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String childFilter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlChildtmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older'  "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -729,6 +736,23 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        helperTotal = helperOff + helperOn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        teacherTotal = teacherOff + teacherOn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //老人家属 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql2 = " select count(id) count,if(openid is null,0,1) online from base_patient where  archive_type=3 and del=1 GROUP BY online; "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> oldFamilyList2 = jdbcTemplate.queryForList(sql2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for(Map<String,Object>tmp:oldFamilyList2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer num = Integer.valueOf(tmp.get("count").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer online = Integer.valueOf(tmp.get("online").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (0==online){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                olderFamilyOff+=num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (1==online){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                olderFamilyOn+=num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        olderFamilyTotal = olderFamilyOff+olderFamilyOn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //家属绑定老人数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        olderFamilyBinding = carePatientService.findOlderFamilyTotal(null,""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("olderTotal", olderTotal); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("childTotal", childTotal); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -743,6 +767,12 @@ public class StatisticsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("helperOff", helperOff); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("teacherOff", teacherOff); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("olderOff", olderOff); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //老人家属 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("olderFamilyTotal", olderFamilyTotal); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("olderFamilyOn", olderFamilyOn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("olderFamilyOff", olderFamilyOff); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("olderFamilyBinding", olderFamilyBinding); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |