|  | @ -312,30 +312,26 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 指标期间      增长量
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param startDate
 | 
	
		
			
				|  |  |      * 如果是查找去年的 前端根据endDate来查看 2016年度 就传 2017-6-30
 | 
	
		
			
				|  |  |      * @param endDate
 | 
	
		
			
				|  |  |      * @param area
 | 
	
		
			
				|  |  |      * @param level
 | 
	
		
			
				|  |  |      * @param index
 | 
	
		
			
				|  |  |      * @param index 6 7 8 15 16
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @RequestMapping("/leveltwo_increment")
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     public String getIndexLevelTwoIncrement(@RequestParam(required = false) String startDate,
 | 
	
		
			
				|  |  |     public String getIndexLevelTwoIncrement(
 | 
	
		
			
				|  |  |                                             @RequestParam(required = true) String endDate,
 | 
	
		
			
				|  |  |                                             @RequestParam(required = true) String area,
 | 
	
		
			
				|  |  |                                             @RequestParam(required = true) int level,
 | 
	
		
			
				|  |  |                                             @RequestParam(required = true) String index,
 | 
	
		
			
				|  |  |                                             @RequestParam(required = false) String year) {
 | 
	
		
			
				|  |  |                                             @RequestParam(required = true) String index) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             String[] indexes = index.split(",");
 | 
	
		
			
				|  |  |             JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             for (String idx : indexes) {
 | 
	
		
			
				|  |  |                 result.put("index_" + idx, statisticsAllService.getIndexLevelTwototal(endDate, area, level, idx));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", result);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
	
		
			
				|  | @ -346,7 +342,8 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取签约率、签约完成率
 | 
	
		
			
				|  |  |      *t
 | 
	
		
			
				|  |  |      * t
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param endDate 截止日期
 | 
	
		
			
				|  |  |      * @param area    区域
 | 
	
		
			
				|  |  |      * @param level   区域级别 4:城市 3:区 2:社区 1:团队
 | 
	
	
		
			
				|  | @ -552,37 +549,6 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 二级指标 到达量  废弃接口 前端没有调用
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param date
 | 
	
		
			
				|  |  |      * @param area
 | 
	
		
			
				|  |  |      * @param level
 | 
	
		
			
				|  |  |      * @param index
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/leveltwo_all")
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @Deprecated
 | 
	
		
			
				|  |  |     public String getIndexLevelTwoTotal(@RequestParam(required = true) String date,
 | 
	
		
			
				|  |  |                                         @RequestParam(required = true) String area,
 | 
	
		
			
				|  |  |                                         @RequestParam(required = true) int level,
 | 
	
		
			
				|  |  |                                         @RequestParam(required = true) String index) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             String[] indexes = index.split(",");
 | 
	
		
			
				|  |  |             JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             for (String idx : indexes) {
 | 
	
		
			
				|  |  |                 result.put("index_" + idx, statisticsAllService.getIndexLevelTwototal(date, area, level, idx));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", result);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return error(-1, "查询失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 指标截止日期  到达量
 | 
	
		
			
				|  |  |      *
 | 
	
	
		
			
				|  | @ -678,6 +644,7 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  |                 return error(-1, "查询失败");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return error(-1, "查询失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -716,6 +683,7 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  |                 return error(-1, "查询失败");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return error(-1, "查询失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -1438,40 +1406,40 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  |             @RequestParam(required = true) String level,
 | 
	
		
			
				|  |  |             @RequestParam(required = true) String code) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             String switchIndex="";
 | 
	
		
			
				|  |  |             String switchIndexReson="";
 | 
	
		
			
				|  |  |             String signIn="";
 | 
	
		
			
				|  |  |             String signOut="";
 | 
	
		
			
				|  |  |             if("1".equals(level)){
 | 
	
		
			
				|  |  |             String switchIndex = "";
 | 
	
		
			
				|  |  |             String switchIndexReson = "";
 | 
	
		
			
				|  |  |             String signIn = "";
 | 
	
		
			
				|  |  |             String signOut = "";
 | 
	
		
			
				|  |  |             if ("1".equals(level)) {
 | 
	
		
			
				|  |  |                 //团队的转签人数
 | 
	
		
			
				|  |  |                 switchIndex="37";
 | 
	
		
			
				|  |  |                 switchIndex = "37";
 | 
	
		
			
				|  |  |                 //团队的转签原因
 | 
	
		
			
				|  |  |                 switchIndexReson="30";
 | 
	
		
			
				|  |  |                 switchIndexReson = "30";
 | 
	
		
			
				|  |  |                 //团队的签入
 | 
	
		
			
				|  |  |                 signIn="34";
 | 
	
		
			
				|  |  |                 signIn = "34";
 | 
	
		
			
				|  |  |                 //团队的签出
 | 
	
		
			
				|  |  |                 signOut="35";
 | 
	
		
			
				|  |  |             }else if("2".equals(level)){
 | 
	
		
			
				|  |  |                 signOut = "35";
 | 
	
		
			
				|  |  |             } else if ("2".equals(level)) {
 | 
	
		
			
				|  |  |                 //社区的续签量
 | 
	
		
			
				|  |  |                 switchIndex="45";
 | 
	
		
			
				|  |  |                 switchIndex = "45";
 | 
	
		
			
				|  |  |                 //社区的转签原因
 | 
	
		
			
				|  |  |                 switchIndexReson="47";
 | 
	
		
			
				|  |  |                 switchIndexReson = "47";
 | 
	
		
			
				|  |  |                 //社区的签入
 | 
	
		
			
				|  |  |                 signIn="38";
 | 
	
		
			
				|  |  |                 signIn = "38";
 | 
	
		
			
				|  |  |                 //社区的签出
 | 
	
		
			
				|  |  |                 signOut="39";
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 signOut = "39";
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 //区和市的续签量
 | 
	
		
			
				|  |  |                 switchIndex="46";
 | 
	
		
			
				|  |  |                 switchIndex = "46";
 | 
	
		
			
				|  |  |                 //区和市的转签原因
 | 
	
		
			
				|  |  |                 switchIndexReson="48";
 | 
	
		
			
				|  |  |                 switchIndexReson = "48";
 | 
	
		
			
				|  |  |                 //区和市的签入
 | 
	
		
			
				|  |  |                 signIn="40";
 | 
	
		
			
				|  |  |                 signIn = "40";
 | 
	
		
			
				|  |  |                 //区和市的签出
 | 
	
		
			
				|  |  |                 signOut="41";
 | 
	
		
			
				|  |  |                 signOut = "41";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", statisticsService.getRenewAnalysis(switchIndex,switchIndexReson,signIn,signOut,level, code));
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", statisticsService.getRenewAnalysis(switchIndex, switchIndexReson, signIn, signOut, level, code));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1, "查询失败");
 | 
	
	
		
			
				|  | @ -1496,43 +1464,43 @@ public class StatisticsController extends BaseController {
 | 
	
		
			
				|  |  |      * 去年的签约量,续签量和续签率 列表
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param area
 | 
	
		
			
				|  |  |      * @param level   level1_type等级 1:团队 2社区机构 3区级 4市级
 | 
	
		
			
				|  |  |      * @param sort    0:升序 1:降序
 | 
	
		
			
				|  |  |      * @param level    level1_type等级 1:团队 2社区机构 3区级 4市级
 | 
	
		
			
				|  |  |      * @param sort     0:升序 1:降序
 | 
	
		
			
				|  |  |      * @param lowLevel 只有可能是 1,2,3,
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @RequestMapping("/lowlevel_all_sign_renew")
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     public String getIndexLowLevelTotalSignAndRenew(
 | 
	
		
			
				|  |  |                                                     @RequestParam(required = true) String area,
 | 
	
		
			
				|  |  |                                                     @RequestParam(required = true) int level,
 | 
	
		
			
				|  |  |                                                     @RequestParam(required = true) int sort,
 | 
	
		
			
				|  |  |                                                     @RequestParam(required = false) String lowLevel,
 | 
	
		
			
				|  |  |                                                     @RequestParam(required = false) String year) {
 | 
	
		
			
				|  |  |             @RequestParam(required = true) String area,
 | 
	
		
			
				|  |  |             @RequestParam(required = true) int level,
 | 
	
		
			
				|  |  |             @RequestParam(required = true) int sort,
 | 
	
		
			
				|  |  |             @RequestParam(required = false) String lowLevel,
 | 
	
		
			
				|  |  |             @RequestParam(required = false) String year) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  |             //如果年度是空,按当前时间计算是年度是属于那个年度
 | 
	
		
			
				|  |  |             if(org.springframework.util.StringUtils.isEmpty(year)){
 | 
	
		
			
				|  |  |                 year=Constant.getNowYear();
 | 
	
		
			
				|  |  |             if (org.springframework.util.StringUtils.isEmpty(year)) {
 | 
	
		
			
				|  |  |                 year = Constant.getNowYear();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if(org.springframework.util.StringUtils.isEmpty(lowLevel)){
 | 
	
		
			
				|  |  |                 lowLevel=level-1+"";
 | 
	
		
			
				|  |  |             if (org.springframework.util.StringUtils.isEmpty(lowLevel)) {
 | 
	
		
			
				|  |  |                 lowLevel = level - 1 + "";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             String index="";
 | 
	
		
			
				|  |  |             if(1==level){
 | 
	
		
			
				|  |  |             String index = "";
 | 
	
		
			
				|  |  |             if (1 == level) {
 | 
	
		
			
				|  |  |                 //团队的续签量
 | 
	
		
			
				|  |  |                 index="42";
 | 
	
		
			
				|  |  |             }else if(2==level){
 | 
	
		
			
				|  |  |                 index = "42";
 | 
	
		
			
				|  |  |             } else if (2 == level) {
 | 
	
		
			
				|  |  |                 //社区的续签量
 | 
	
		
			
				|  |  |                 index="43";
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 index = "43";
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 //区和市的续签量
 | 
	
		
			
				|  |  |                 index="44";
 | 
	
		
			
				|  |  |                 index = "44";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             result.put("index_29" , statisticsAllService.getLevelTwoLowLevelTotalSignAndRenew( area, level, index, sort, lowLevel,year));
 | 
	
		
			
				|  |  |             result.put("index_29", statisticsAllService.getLevelTwoLowLevelTotalSignAndRenew(area, level, index, sort, lowLevel, year));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", result);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 |