|  | @ -2517,35 +2517,39 @@ public class StatisticsService {
 | 
	
		
			
				|  |  |                 " on life.hospital = org.code   where life.`status`=2  and org.code not in (select dict_code from wlyy_hospital_sys_dict "+
 | 
	
		
			
				|  |  |                 "          where dict_name ='jkzl_org') and org.del=1 ";
 | 
	
		
			
				|  |  |         List<Map<String,Object>> tmpList = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         Map<String,List<Map<String,Object>>> numList = tmpList.stream().collect(Collectors.groupingBy(e->e.get("hospital").toString()));
 | 
	
		
			
				|  |  |         sql = " select count(life.id) total,life.hospital,org.name from base_life_care_order life INNER JOIN  base_org org " +
 | 
	
		
			
				|  |  |                 " on life.hospital = org.code   where life.`status` in (1,3)  and org.code not in (select dict_code from wlyy_hospital_sys_dict "+
 | 
	
		
			
				|  |  |                 "          where dict_name ='jkzl_org') and org.del=1 ";
 | 
	
		
			
				|  |  |         tmpList = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         Map<String,List<Map<String,Object>>> numList2 = tmpList.stream().collect(Collectors.groupingBy(e->e.get("hospital").toString()));
 | 
	
		
			
				|  |  |         for (Map<String, Object> tmp : list) {
 | 
	
		
			
				|  |  |             if (numList.containsKey(tmp.get("code"))||numList2.containsKey(tmp.get("code"))) {
 | 
	
		
			
				|  |  |                 Long finish=0l;
 | 
	
		
			
				|  |  |                 Long unfinish=0l;
 | 
	
		
			
				|  |  |                 if (numList.containsKey(tmp.get("code"))){
 | 
	
		
			
				|  |  |                     finish =Long.valueOf(numList.get(tmp.get("code")).get(0).get("total").toString());
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if (numList2.containsKey(tmp.get("code"))){
 | 
	
		
			
				|  |  |                     unfinish =Long.valueOf(numList2.get(tmp.get("code")).get(0).get("total").toString());
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             Map<String,List<Map<String,Object>>> numList = tmpList.stream().collect(Collectors.groupingBy(e->e.get("hospital").toString()));
 | 
	
		
			
				|  |  |             sql = " select count(life.id) total,life.hospital,org.name from base_life_care_order life INNER JOIN  base_org org " +
 | 
	
		
			
				|  |  |                     " on life.hospital = org.code   where life.`status` in (1,3)  and org.code not in (select dict_code from wlyy_hospital_sys_dict "+
 | 
	
		
			
				|  |  |                     "          where dict_name ='jkzl_org') and org.del=1 ";
 | 
	
		
			
				|  |  |             tmpList = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |             Map<String,List<Map<String,Object>>> numList2 = tmpList.stream().collect(Collectors.groupingBy(e->e.get("hospital").toString()));
 | 
	
		
			
				|  |  |             for (Map<String, Object> tmp : list) {
 | 
	
		
			
				|  |  |                 if (numList.containsKey(tmp.get("code"))||numList2.containsKey(tmp.get("code"))) {
 | 
	
		
			
				|  |  |                     Long finish=0l;
 | 
	
		
			
				|  |  |                     Long unfinish=0l;
 | 
	
		
			
				|  |  |                     if (numList.containsKey(tmp.get("code"))){
 | 
	
		
			
				|  |  |                         finish =Long.valueOf(numList.get(tmp.get("code")).get(0).get("total").toString());
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     if (numList2.containsKey(tmp.get("code"))){
 | 
	
		
			
				|  |  |                         unfinish =Long.valueOf(numList2.get(tmp.get("code")).get(0).get("total").toString());
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     tmp.put("finish", finish);
 | 
	
		
			
				|  |  |                     tmp.put("unfinish", unfinish);
 | 
	
		
			
				|  |  |                     tmp.put("total", finish+unfinish);
 | 
	
		
			
				|  |  |                     tmp.put("law", commonUtil.getRangeDouble(finish.intValue(),(finish.intValue()+unfinish.intValue())));
 | 
	
		
			
				|  |  |                 } else {
 | 
	
		
			
				|  |  |                     tmp.put("finish", 0);
 | 
	
		
			
				|  |  |                     tmp.put("unfinish", 0);
 | 
	
		
			
				|  |  |                     tmp.put("total", 0);
 | 
	
		
			
				|  |  |                     tmp.put("law", 0);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 tmp.put("finish", finish);
 | 
	
		
			
				|  |  |                 tmp.put("unfinish", unfinish);
 | 
	
		
			
				|  |  |                 tmp.put("total", finish+unfinish);
 | 
	
		
			
				|  |  |                 tmp.put("law", commonUtil.getRangeDouble(finish.intValue(),(finish.intValue()+unfinish.intValue())));
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 tmp.put("finish", 0);
 | 
	
		
			
				|  |  |                 tmp.put("unfinish", 0);
 | 
	
		
			
				|  |  |                 tmp.put("total", 0);
 | 
	
		
			
				|  |  |                 tmp.put("law", 0);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             list.sort(Comparator.comparing(obj -> Double.parseDouble(((Map<String,Object>) obj).get("law").toString())).reversed());
 | 
	
		
			
				|  |  |             if (list.size()>0){
 | 
	
		
			
				|  |  |                 list.sort(Comparator.comparing(obj -> Double.parseDouble(((Map<String,Object>) obj).get("law").toString())).reversed());
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return null;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return list;
 | 
	
		
			
				|  |  |     }
 |