| 
					
				 | 
			
			
				@ -2276,6 +2276,66 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return resultMaps; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 团队报告团队详情中健康教育折线图 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param teamCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param startDate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param endDate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONArray getTeamEduLine(String teamCode, String startDate, String endDate, String type)throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        startDate = startDate + " 00:00:00"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        endDate = endDate + " 23:59:59"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> dateList = DateUtil.findDates(dateFormat.parse(startDate),dateFormat.parse(endDate)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> articleCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"59",SaveModel.timeLevel_ZL,String.valueOf(interval)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> batchNoCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"71",SaveModel.timeLevel_ZL,String.valueOf(interval)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(articleCountList!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //循环人数集合 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (SaveModel one1:articleCountList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String date = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(one1.getQuotaDate()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    date=dateFormat.format(one1.getQuotaDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (one1.getResult2().intValue()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Map<String,Object> map = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("articleCount",one1.getResult2().intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //查看批次集合里是否有同时间的数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    for (SaveModel one2:batchNoCountList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (one2.getQuotaDate()!=null && dateFormat.format(one2.getQuotaDate()).equals(date)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            map.put("batchCount",one2.getResult2().intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        map.put("dateNo",date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        map.put("weekOfMonth", DateUtil.getWeekOfMonth(date)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    list.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //循环批次 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    for (SaveModel one2:batchNoCountList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (one2.getResult2().intValue()!=0 && one2.getQuotaDate()!=null && dateFormat.format(one2.getQuotaDate()).equals(date)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            Map<String,Object> map = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            map.put("articleCount",0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            map.put("batchCount",one2.getResult2().intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                map.put("dateNo",dateFormat.format(date)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                map.put("weekOfMonth", DateUtil.getWeekOfMonth(date)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            list.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new JSONArray(list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject getRenewPercentAndChangePercent(String index, Integer level, String area, String year, String lowCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject jo = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String switchIndex = "";//转签index 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2946,7 +3006,7 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("dateNo",dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("noRely", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                noReyList.add(map); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2973,7 +3033,7 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取团队随访量折线统计图(弃用) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取团队随访量折线统计图 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param teamCode 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2983,11 +3043,12 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject getTeamFollowupLine(String teamCode, String startDate, String endDate, String type) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "4", "2", interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list1 = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "69", SaveModel.timeLevel_ZL, interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list2 = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "70", SaveModel.timeLevel_ZL, interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> map = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> totalList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (SaveModel one : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (SaveModel one : list1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2997,8 +3058,21 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("followupCount", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            totalList.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> planList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (SaveModel one : list2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("planCount", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            planList.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("planList", planList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("totalList", totalList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3014,19 +3088,21 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        startDate = elasticsearchUtil.changeTime(startDate + " 00:00:00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        endDate = elasticsearchUtil.changeTime(endDate + " 23:59:59"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "27", "2", interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "27", SaveModel.timeLevel_ZL, interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> map = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> totalList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (SaveModel one : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (one.getResult2().intValue()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("reservationCount", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalList.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("reservationCount", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            totalList.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new JSONArray(totalList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3192,19 +3268,21 @@ public class StatisticsESService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        startDate = elasticsearchUtil.changeTime(startDate + " 00:00:00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        endDate = elasticsearchUtil.changeTime(endDate + " 23:59:59"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "5", "2", interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer interval = Integer.parseInt(type) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, teamCode, Integer.parseInt(SaveModel.teamLevel), "5", SaveModel.timeLevel_ZL, interval + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> map = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> totalList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (SaveModel one : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (one.getResult2().intValue()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("0".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("dateNo", dateFormat.format(one.getQuotaDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate()))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("guidanceCount", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalList.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("guidanceCount", one.getResult2().longValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            totalList.add(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new JSONArray(totalList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 |