|  | @ -46,7 +46,7 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |      * @param wlyyQuotaId
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void saveByLevel1(List<Map<String, List<ETLModel>>> data, String wlyyQuotaId) throws Exception {
 | 
	
		
			
				|  |  |     public void saveByLevel1(List<Map<String, List<ETLModel>>> data,List<Map<String, List<ETLModel>>> deleteData, String wlyyQuotaId) throws Exception {
 | 
	
		
			
				|  |  |         List<AdminTeam> adminTeams=doctorAdminTeamDao.findAllTeam();
 | 
	
		
			
				|  |  |         Map<String, AdminTeam> adminTeamMap = new HashMap<String, AdminTeam>();
 | 
	
		
			
				|  |  |         for (AdminTeam adminTeam : adminTeams) {
 | 
	
	
		
			
				|  | @ -76,16 +76,29 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |         Map<String, List<ETLModel>> townTeam=data.get(2);//区的数据
 | 
	
		
			
				|  |  |         Map<String, List<ETLModel>> cityTeam=data.get(3);//市的数据
 | 
	
		
			
				|  |  |         redisTemplate.opsForValue().set("quota:date",DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |         //保存市
 | 
	
		
			
				|  |  |         saveLevel1City(wlyyQuotaId, cityMap, cityTeam);
 | 
	
		
			
				|  |  |         //保存区
 | 
	
		
			
				|  |  |         saveLevel1Town(wlyyQuotaId, townsMap, townTeam);
 | 
	
		
			
				|  |  |         //保存机构
 | 
	
		
			
				|  |  |         saveLevel1Org(wlyyQuotaId, hospitalsMap, orgTeam);
 | 
	
		
			
				|  |  |         //保存全科团队
 | 
	
		
			
				|  |  |         saveLevel1Team(wlyyQuotaId, adminTeamMap, adminTeam);
 | 
	
		
			
				|  |  |         if(deleteData==null){
 | 
	
		
			
				|  |  |             //保存市
 | 
	
		
			
				|  |  |             saveLevel1City(wlyyQuotaId, cityMap, cityTeam);
 | 
	
		
			
				|  |  |             //保存区
 | 
	
		
			
				|  |  |             saveLevel1Town(wlyyQuotaId, townsMap, townTeam);
 | 
	
		
			
				|  |  |             //保存机构
 | 
	
		
			
				|  |  |             saveLevel1Org(wlyyQuotaId, hospitalsMap, orgTeam);
 | 
	
		
			
				|  |  |             //保存全科团队
 | 
	
		
			
				|  |  |             saveLevel1Team(wlyyQuotaId,adminTeamMap, adminTeam);
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             //保存市
 | 
	
		
			
				|  |  |             saveLevel1City(wlyyQuotaId, cityMap, cityTeam,deleteData.get(3));
 | 
	
		
			
				|  |  |             //保存区
 | 
	
		
			
				|  |  |             saveLevel1Town(wlyyQuotaId, townsMap, townTeam,deleteData.get(2));
 | 
	
		
			
				|  |  |             //保存机构
 | 
	
		
			
				|  |  |             saveLevel1Org(wlyyQuotaId, hospitalsMap, orgTeam,deleteData.get(1));
 | 
	
		
			
				|  |  |             //保存全科团队
 | 
	
		
			
				|  |  |             saveLevel1Team(wlyyQuotaId,adminTeamMap, adminTeam,deleteData.get(0));
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 保存二级维度的数据
 | 
	
		
			
				|  |  |      * @param data
 | 
	
	
		
			
				|  | @ -93,9 +106,9 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |      * @param foreachNum 标识二级维度循环的次数  例如 年龄就传6  性别就传3
 | 
	
		
			
				|  |  |      * @param type 1 性别 2 年龄 3 用户分组 4.签约费用 5 健康分布
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void saveByLevel2(List<Map<String, Map<String, List<ETLModel>>>> data, String wlyyQuotaId,Integer foreachNum,Integer type) throws Exception {
 | 
	
		
			
				|  |  |     public void saveByLevel2(List<Map<String, Map<String, List<ETLModel>>>> data,List<Map<String, Map<String, List<ETLModel>>>> deleteData, String wlyyQuotaId,Integer foreachNum,Integer type) throws Exception {
 | 
	
		
			
				|  |  |         Integer start=1;
 | 
	
		
			
				|  |  |         saveByLevel2Public(data, wlyyQuotaId, foreachNum, type, start);
 | 
	
		
			
				|  |  |         saveByLevel2Public(data,deleteData, wlyyQuotaId, foreachNum, type, start);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 保存二级维度的数据
 | 
	
	
		
			
				|  | @ -105,8 +118,8 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |      * @param type 1 性别 2 年龄 3 用户分组 4.签约费用 5 健康分布
 | 
	
		
			
				|  |  |      * @param start 循环开始
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void saveByLevel2(List<Map<String, Map<String, List<ETLModel>>>> data, String wlyyQuotaId,Integer foreachNum,Integer type,Integer start) throws Exception {
 | 
	
		
			
				|  |  |         saveByLevel2Public(data, wlyyQuotaId, foreachNum, type, start);
 | 
	
		
			
				|  |  |     public void saveByLevel2(List<Map<String, Map<String, List<ETLModel>>>> data,List<Map<String, Map<String, List<ETLModel>>>> deleteData, String wlyyQuotaId,Integer foreachNum,Integer type,Integer start) throws Exception {
 | 
	
		
			
				|  |  |         saveByLevel2Public(data,deleteData, wlyyQuotaId, foreachNum, type, start);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 保存三级维度的数据
 | 
	
	
		
			
				|  | @ -119,7 +132,7 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |      * @param start2 循环开始
 | 
	
		
			
				|  |  |      * @param start3 循环开始
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void saveByLevel3(List<Map<String, Map<String, Map<String, List<ETLModel>>>>> data, String wlyyQuotaId,Integer foreachNum2,Integer foreachNum3,Integer type2,Integer type3,Integer start2,Integer start3) throws Exception {
 | 
	
		
			
				|  |  |     public void saveByLevel3(List<Map<String, Map<String, Map<String, List<ETLModel>>>>> data,List<Map<String, Map<String, Map<String, List<ETLModel>>>>> deleteData, String wlyyQuotaId,Integer foreachNum2,Integer foreachNum3,Integer type2,Integer type3,Integer start2,Integer start3) throws Exception {
 | 
	
		
			
				|  |  |         if(start2==null){
 | 
	
		
			
				|  |  |             start2=1;
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -146,16 +159,74 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |         city.setName(Constant.cityName);
 | 
	
		
			
				|  |  |         Map<String, City> cityMap = new HashMap<String, City>();
 | 
	
		
			
				|  |  |         cityMap.put(Constant.city,city);
 | 
	
		
			
				|  |  |         //保存团队
 | 
	
		
			
				|  |  |         saveAdminTeamDataLevel3(data.get(0),wlyyQuotaId,adminTeamMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |         //保存机构
 | 
	
		
			
				|  |  |         saveHospitalTeamDataLevel3(data.get(1),wlyyQuotaId,hospitalsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |         //保存区
 | 
	
		
			
				|  |  |         saveTownTeamDataLevel3(data.get(2),wlyyQuotaId,townsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |         //保存市
 | 
	
		
			
				|  |  |         saveCityTeamDataLevel3(data.get(3),wlyyQuotaId,cityMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |         if(deleteData!=null){
 | 
	
		
			
				|  |  |             //保存团队
 | 
	
		
			
				|  |  |             saveAdminTeamDataLevel3(data.get(0),deleteData.get(0),wlyyQuotaId,adminTeamMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |             //保存机构
 | 
	
		
			
				|  |  |             saveHospitalTeamDataLevel3(data.get(1),deleteData.get(1),wlyyQuotaId,hospitalsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |             //保存区
 | 
	
		
			
				|  |  |             saveTownTeamDataLevel3(data.get(2),deleteData.get(2),wlyyQuotaId,townsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |             //保存市
 | 
	
		
			
				|  |  |             saveCityTeamDataLevel3(data.get(3),deleteData.get(3),wlyyQuotaId,cityMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             //保存团队
 | 
	
		
			
				|  |  |             saveAdminTeamDataLevel3(data.get(0),wlyyQuotaId,adminTeamMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |             //保存机构
 | 
	
		
			
				|  |  |             saveHospitalTeamDataLevel3(data.get(1),wlyyQuotaId,hospitalsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |             //保存区
 | 
	
		
			
				|  |  |             saveTownTeamDataLevel3(data.get(2),wlyyQuotaId,townsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |             //保存市
 | 
	
		
			
				|  |  |             saveCityTeamDataLevel3(data.get(3),wlyyQuotaId,cityMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveAdminTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,Map<String, Map<String, Map<String, List<ETLModel>>>> deleteEtlModelMap, String wlyyQuotaId,Map<String, AdminTeam> adminTeamMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,AdminTeam> oneAdminTeam:adminTeamMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneAdminTeam.getKey());
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> deleteTwoETLMap= deleteEtlModelMap.get(oneAdminTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap=null;
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> deleteThreeETLMap=null;
 | 
	
		
			
				|  |  |                 if(deleteTwoETLMap!=null){
 | 
	
		
			
				|  |  |                     deleteThreeETLMap=deleteTwoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  |                     String level1="1";
 | 
	
		
			
				|  |  |                     String level2=i+"";
 | 
	
		
			
				|  |  |                     String level3=j+"";
 | 
	
		
			
				|  |  |                     int num=0;
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= threeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     if(deleteThreeETLMap!=null){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= deleteThreeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=num-etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     AdminTeam adminTeamObj = adminTeamMap.get(oneAdminTeam.getKey());//团队
 | 
	
		
			
				|  |  |                     if(adminTeamObj==null)continue;
 | 
	
		
			
				|  |  |                     JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                     jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                     jo.put("num", num);
 | 
	
		
			
				|  |  |                     jo.put("teamName", adminTeamObj.getName());
 | 
	
		
			
				|  |  |                     jo.put("teamId", adminTeamObj.getId());
 | 
	
		
			
				|  |  |                     jo.put("name", getLevel3Name(level3,type3));
 | 
	
		
			
				|  |  |                     redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+level2+":"+level3+":"+adminTeamObj.getId()).toString(), jo.toString());
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveAdminTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String wlyyQuotaId,Map<String, AdminTeam> adminTeamMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,AdminTeam> oneAdminTeam:adminTeamMap.entrySet()){
 | 
	
	
		
			
				|  | @ -191,7 +262,6 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private String getLevel3Name(String j, Integer type) {
 | 
	
		
			
				|  |  |         switch (type){
 | 
	
		
			
				|  |  |             case  1:{
 | 
	
	
		
			
				|  | @ -204,18 +274,22 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveHospitalTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,String wlyyQuotaId, Map<String, Hospital> hospitalMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
 | 
	
		
			
				|  |  |     private void saveHospitalTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,Map<String, Map<String, Map<String, List<ETLModel>>>> deleteEtlModelMap,String wlyyQuotaId, Map<String, Hospital> hospitalMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Hospital> oneHospital:hospitalMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneHospital.getKey());
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> deleteTwoETLMap= deleteEtlModelMap.get(oneHospital.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> deleteThreeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(deleteTwoETLMap!=null){
 | 
	
		
			
				|  |  |                     deleteThreeETLMap=deleteTwoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  |                     String level1="2";
 | 
	
		
			
				|  |  |                     String level2=i+"";
 | 
	
	
		
			
				|  | @ -227,7 +301,42 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null){
 | 
	
		
			
				|  |  |                     if(deleteThreeETLMap!=null&&deleteThreeETLMap.size()>0){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= deleteThreeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=num-etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     Hospital hospital = hospitalsMap.get(oneHospital.getKey());
 | 
	
		
			
				|  |  |                     if(hospital==null)continue;
 | 
	
		
			
				|  |  |                     JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                     jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                     jo.put("num", num);
 | 
	
		
			
				|  |  |                     jo.put("orgName", hospital.getName());
 | 
	
		
			
				|  |  |                     jo.put("orgCode", hospital.getCode());
 | 
	
		
			
				|  |  |                     jo.put("name", getLevel3Name(level3,type3));
 | 
	
		
			
				|  |  |                     redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+level2+":"+level3+":"+hospital.getCode()).toString(), jo.toString());
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveHospitalTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,String wlyyQuotaId, Map<String, Hospital> hospitalMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Hospital> oneHospital:hospitalMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneHospital.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  |                     String level1="2";
 | 
	
		
			
				|  |  |                     String level2=i+"";
 | 
	
		
			
				|  |  |                     String level3=j+"";
 | 
	
		
			
				|  |  |                     int num=0;
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null&&threeETLMap.size()>0){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= threeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
	
		
			
				|  | @ -246,18 +355,23 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveTownTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,String wlyyQuotaId, Map<String, Town> townsMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |     private void saveTownTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,Map<String, Map<String, Map<String, List<ETLModel>>>> deleteEtlModelMap,String wlyyQuotaId, Map<String, Town> townsMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Town> oneTownTeam:townsMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneTownTeam.getKey());
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> deleteTwoETLMap= deleteEtlModelMap.get(oneTownTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> deleteThreeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(deleteTwoETLMap!=null){
 | 
	
		
			
				|  |  |                     deleteThreeETLMap=deleteTwoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  |                     String level1="3";
 | 
	
		
			
				|  |  |                     String level2=i+"";
 | 
	
	
		
			
				|  | @ -269,10 +383,10 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= threeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                     if(deleteThreeETLMap!=null&&deleteThreeETLMap.size()>0){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= deleteThreeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
		
			
				|  |  |                             num=num-etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     Town town=townsMap.get(oneTownTeam.getKey());
 | 
	
	
		
			
				|  | @ -288,18 +402,23 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveCityTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,String wlyyQuotaId, Map<String, City> cityMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |     private void saveCityTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,Map<String, Map<String, Map<String, List<ETLModel>>>> deleteEtlModelMap,String wlyyQuotaId, Map<String, City> cityMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,City> oneCityTeam:cityMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneCityTeam.getKey());
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> deleteTwoETLMap= deleteEtlModelMap.get(oneCityTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> deletetThreeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(deleteTwoETLMap!=null){
 | 
	
		
			
				|  |  |                     deletetThreeETLMap=deleteTwoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     String level1="4";
 | 
	
	
		
			
				|  | @ -312,7 +431,81 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null){
 | 
	
		
			
				|  |  |                     if(deletetThreeETLMap!=null&&deletetThreeETLMap.size()>0){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= deletetThreeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=num-etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     City cityObj=oneCityTeam.getValue();
 | 
	
		
			
				|  |  |                     JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                     jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                     jo.put("num", num);
 | 
	
		
			
				|  |  |                     jo.put("cityName", cityObj.getName());
 | 
	
		
			
				|  |  |                     jo.put("cityCode", cityObj.getCode());
 | 
	
		
			
				|  |  |                     jo.put("name", getLevel3Name(level3,type3));
 | 
	
		
			
				|  |  |                     redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+level2+":"+level3+":"+cityObj.getCode()).toString(), jo.toString());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveTownTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,String wlyyQuotaId, Map<String, Town> townsMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Town> oneTownTeam:townsMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneTownTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  |                     String level1="3";
 | 
	
		
			
				|  |  |                     String level2=i+"";
 | 
	
		
			
				|  |  |                     String level3=j+"";
 | 
	
		
			
				|  |  |                     int num=0;
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null&&threeETLMap.size()>0){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= threeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     Town town=townsMap.get(oneTownTeam.getKey());
 | 
	
		
			
				|  |  |                     if(town==null)continue;
 | 
	
		
			
				|  |  |                     JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                     jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                     jo.put("num", num);
 | 
	
		
			
				|  |  |                     jo.put("townName", town.getName());
 | 
	
		
			
				|  |  |                     jo.put("townCode", town.getCode());
 | 
	
		
			
				|  |  |                     jo.put("name", getLevel3Name(level3,type3));
 | 
	
		
			
				|  |  |                     redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+level2+":"+level3+":"+town.getCode()).toString(), jo.toString());
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveCityTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap,String wlyyQuotaId, Map<String, City> cityMap, Integer foreachNum2, Integer foreachNum3, Integer type2, Integer type3, Integer start2, Integer start3) {
 | 
	
		
			
				|  |  |         List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
 | 
	
		
			
				|  |  |         //遍历团队的Map
 | 
	
		
			
				|  |  |         for(Map.Entry<String,City> oneCityTeam:cityMap.entrySet()){
 | 
	
		
			
				|  |  |             //得到每个团队的2级维度
 | 
	
		
			
				|  |  |             Map<String, Map<String, List<ETLModel>>> twoETLMap= etlModelMap.get(oneCityTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start2;i<=foreachNum2;i++){
 | 
	
		
			
				|  |  |                 //得到每个团队的三级维度
 | 
	
		
			
				|  |  |                 Map<String, List<ETLModel>> threeETLMap= new HashMap<String, List<ETLModel>>();
 | 
	
		
			
				|  |  |                 if(twoETLMap!=null){
 | 
	
		
			
				|  |  |                     threeETLMap=twoETLMap.get(i+"");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 for(int j=start3;j<=foreachNum3;j++){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     String level1="4";
 | 
	
		
			
				|  |  |                     String level2=i+"";
 | 
	
		
			
				|  |  |                     String level3=j+"";
 | 
	
		
			
				|  |  |                     int num=0;
 | 
	
		
			
				|  |  |                     if(threeETLMap!=null&&threeETLMap.size()>0){
 | 
	
		
			
				|  |  |                         List<ETLModel> etlModelList= threeETLMap.get(j+"");
 | 
	
		
			
				|  |  |                         if(etlModelList!=null&&etlModelList.size()>0){
 | 
	
		
			
				|  |  |                             num=etlModelList.size();
 | 
	
	
		
			
				|  | @ -331,7 +524,8 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveByLevel2Public(List<Map<String, Map<String, List<ETLModel>>>> data, String wlyyQuotaId, Integer foreachNum, Integer type, Integer start) {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveByLevel2Public(List<Map<String, Map<String, List<ETLModel>>>> data,List<Map<String, Map<String, List<ETLModel>>>> deleteData, String wlyyQuotaId, Integer foreachNum, Integer type, Integer start) {
 | 
	
		
			
				|  |  |         List<AdminTeam> adminTeams=doctorAdminTeamDao.findAllTeam();
 | 
	
		
			
				|  |  |         Map<String, AdminTeam> adminTeamMap = new HashMap<String, AdminTeam>();
 | 
	
		
			
				|  |  |         for (AdminTeam adminTeam : adminTeams) {
 | 
	
	
		
			
				|  | @ -362,19 +556,31 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |         Map<String, Map<String, List<ETLModel>>> cityTeam=data.get(3);//市的数据
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         redisTemplate.opsForValue().set("quota:date",DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |         //保存市
 | 
	
		
			
				|  |  |         saveLevel2City(wlyyQuotaId, cityMap, cityTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |         //保存区
 | 
	
		
			
				|  |  |         saveLevel2Town(wlyyQuotaId, townsMap, townTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |         //保存机构
 | 
	
		
			
				|  |  |         saveLevel2Org(wlyyQuotaId, hospitalsMap, orgTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |         //保存全科团队
 | 
	
		
			
				|  |  |         saveLevel2Team(wlyyQuotaId, adminTeamMap, adminTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |         if(deleteData!=null){
 | 
	
		
			
				|  |  |             //保存市
 | 
	
		
			
				|  |  |             saveLevel2City(wlyyQuotaId, cityMap, cityTeam,deleteData.get(3),foreachNum,type,start);
 | 
	
		
			
				|  |  |             //保存区
 | 
	
		
			
				|  |  |             saveLevel2Town(wlyyQuotaId, townsMap, townTeam,deleteData.get(2),foreachNum,type,start);
 | 
	
		
			
				|  |  |             //保存机构
 | 
	
		
			
				|  |  |             saveLevel2Org(wlyyQuotaId, hospitalsMap, orgTeam,deleteData.get(1),foreachNum,type,start);
 | 
	
		
			
				|  |  |             //保存全科团队
 | 
	
		
			
				|  |  |             saveLevel2Team(wlyyQuotaId, adminTeamMap, adminTeam,deleteData.get(0),foreachNum,type,start);
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             //保存市
 | 
	
		
			
				|  |  |             saveLevel2City(wlyyQuotaId, cityMap, cityTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |             //保存区
 | 
	
		
			
				|  |  |             saveLevel2Town(wlyyQuotaId, townsMap, townTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |             //保存机构
 | 
	
		
			
				|  |  |             saveLevel2Org(wlyyQuotaId, hospitalsMap, orgTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |             //保存全科团队
 | 
	
		
			
				|  |  |             saveLevel2Team(wlyyQuotaId, adminTeamMap, adminTeam,foreachNum,type,start);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel2Team(String wlyyQuotaId, Map<String, AdminTeam> adminTeamMap, Map<String, Map<String, List<ETLModel>>> eltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |     private void saveLevel2Team(String wlyyQuotaId, Map<String, AdminTeam> adminTeamMap, Map<String, Map<String, List<ETLModel>>> eltModel, Map<String, Map<String, List<ETLModel>>> deleteEltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,AdminTeam> adminTeam:adminTeamMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(adminTeam.getKey());
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> deleteOneELTMap= deleteEltModel.get(adminTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 AdminTeam adminTeamObj=adminTeam.getValue();
 | 
	
		
			
				|  |  |                 if(adminTeamObj==null)continue;
 | 
	
	
		
			
				|  | @ -386,6 +592,12 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if(deleteOneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= deleteOneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=num-etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("teamName", adminTeamObj.getName());
 | 
	
	
		
			
				|  | @ -396,10 +608,34 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel2Org(String wlyyQuotaId, Map<String, Hospital> hospitalsMap, Map<String, Map<String, List<ETLModel>>> eltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |     private void saveLevel2Team(String wlyyQuotaId, Map<String, AdminTeam> adminTeamMap, Map<String, Map<String, List<ETLModel>>> eltModel,  Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,AdminTeam> adminTeam:adminTeamMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(adminTeam.getKey());
 | 
	
		
			
				|  |  |             for(int i=start;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 AdminTeam adminTeamObj=adminTeam.getValue();
 | 
	
		
			
				|  |  |                 if(adminTeamObj==null)continue;
 | 
	
		
			
				|  |  |                 JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                 int num=0;
 | 
	
		
			
				|  |  |                 if(oneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= oneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("teamName", adminTeamObj.getName());
 | 
	
		
			
				|  |  |                 jo.put("teamId", adminTeamObj.getId());
 | 
	
		
			
				|  |  |                 String key=i+"";
 | 
	
		
			
				|  |  |                 jo.put("name", getLevel2Name(key,type));
 | 
	
		
			
				|  |  |                 redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":1:"+key+":"+adminTeam.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel2Org(String wlyyQuotaId, Map<String, Hospital> hospitalsMap, Map<String, Map<String, List<ETLModel>>> eltModel, Map<String, Map<String, List<ETLModel>>> deleteEltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Hospital> hospital:hospitalsMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(hospital.getKey());
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> deleteOneELTMap= deleteEltModel.get(hospital.getKey());
 | 
	
		
			
				|  |  |             for(int i=start;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 Hospital hospitalObj=hospital.getValue();
 | 
	
		
			
				|  |  |                 if(hospitalObj==null)continue;
 | 
	
	
		
			
				|  | @ -411,6 +647,12 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if(deleteOneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= deleteOneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=num-etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("orgName", hospitalObj.getName());
 | 
	
	
		
			
				|  | @ -421,10 +663,56 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel2Town(String wlyyQuotaId, Map<String, Town> townsMap, Map<String, Map<String, List<ETLModel>>> eltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |     private void saveLevel2Town(String wlyyQuotaId, Map<String, Town> townsMap, Map<String, Map<String, List<ETLModel>>> eltModel,  Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Town> town:townsMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(town.getKey());
 | 
	
		
			
				|  |  |             for(int i=1;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                 int num=0;
 | 
	
		
			
				|  |  |                 if(oneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= oneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("townName", town.getValue().getName());
 | 
	
		
			
				|  |  |                 jo.put("townCode", town.getValue().getCode());
 | 
	
		
			
				|  |  |                 String key=i+"";
 | 
	
		
			
				|  |  |                 jo.put("name", getLevel2Name(key,type));
 | 
	
		
			
				|  |  |                 redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":3:"+key+":"+town.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel2Org(String wlyyQuotaId, Map<String, Hospital> hospitalsMap, Map<String, Map<String, List<ETLModel>>> eltModel,Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Hospital> hospital:hospitalsMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(hospital.getKey());
 | 
	
		
			
				|  |  |             for(int i=start;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 Hospital hospitalObj=hospital.getValue();
 | 
	
		
			
				|  |  |                 if(hospitalObj==null)continue;
 | 
	
		
			
				|  |  |                 JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                 int num=0;
 | 
	
		
			
				|  |  |                 if(oneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= oneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("orgName", hospitalObj.getName());
 | 
	
		
			
				|  |  |                 jo.put("orgCode", hospitalObj.getCode());
 | 
	
		
			
				|  |  |                 String key=i+"";
 | 
	
		
			
				|  |  |                 jo.put("name", getLevel2Name(key,type));
 | 
	
		
			
				|  |  |                 redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":2:"+key+":"+hospital.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel2Town(String wlyyQuotaId, Map<String, Town> townsMap, Map<String, Map<String, List<ETLModel>>> eltModel, Map<String, Map<String, List<ETLModel>>> deleteEltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Town> town:townsMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(town.getKey());
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> deleteOneELTMap= deleteEltModel.get(town.getKey());
 | 
	
		
			
				|  |  |             for(int i=1;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                 int num=0;
 | 
	
	
		
			
				|  | @ -434,6 +722,12 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if(deleteOneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= deleteOneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=num-etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("townName", town.getValue().getName());
 | 
	
	
		
			
				|  | @ -445,7 +739,36 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel2City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, Map<String, List<ETLModel>>> eltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |     private void saveLevel2City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, Map<String, List<ETLModel>>> eltModel, Map<String, Map<String, List<ETLModel>>> deleteEltModel, Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,City> city:cityMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(city.getKey());
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> deleteOneELTMap= deleteEltModel.get(city.getKey());
 | 
	
		
			
				|  |  |             for(int i=start;i<=foreachNum;i++){
 | 
	
		
			
				|  |  |                 JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |                 int num=0;
 | 
	
		
			
				|  |  |                 if(oneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= oneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if(deleteOneELTMap!=null){
 | 
	
		
			
				|  |  |                     List<ETLModel> etlModel= deleteOneELTMap.get(i+"");
 | 
	
		
			
				|  |  |                     if(etlModel!=null&&etlModel.size()>0){
 | 
	
		
			
				|  |  |                         num=num-etlModel.size();
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |                 jo.put("num", num);
 | 
	
		
			
				|  |  |                 jo.put("cityName", city.getValue().getName());
 | 
	
		
			
				|  |  |                 jo.put("cityCode", city.getValue().getCode());
 | 
	
		
			
				|  |  |                 String key=i+"";
 | 
	
		
			
				|  |  |                 jo.put("name", getLevel2Name(key,type));
 | 
	
		
			
				|  |  |                 redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":4:"+key+":"+city.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel2City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, Map<String, List<ETLModel>>> eltModel,  Integer foreachNum, Integer type,Integer start) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,City> city:cityMap.entrySet()){
 | 
	
		
			
				|  |  |             Map<String, List<ETLModel>> oneELTMap= eltModel.get(city.getKey());
 | 
	
		
			
				|  |  |             for(int i=start;i<=foreachNum;i++){
 | 
	
	
		
			
				|  | @ -467,7 +790,6 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel1Team(String wlyyQuotaId, Map<String, AdminTeam> adminTeamMap, Map<String, List<ETLModel>> adminTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,AdminTeam> entry:adminTeamMap.entrySet()){
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
	
		
			
				|  | @ -485,7 +807,29 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":1:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel1Team(String wlyyQuotaId, Map<String, AdminTeam> adminTeamMap, Map<String, List<ETLModel>> adminTeam, Map<String, List<ETLModel>> deleteAdminTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,AdminTeam> entry:adminTeamMap.entrySet()){
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |             Integer num=0;
 | 
	
		
			
				|  |  |             AdminTeam adminTeamObj=entry.getValue();
 | 
	
		
			
				|  |  |             if(adminTeamObj==null)continue;
 | 
	
		
			
				|  |  |             List<ETLModel> etlList=adminTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |             if(etlList!=null&&etlList.size()>0){
 | 
	
		
			
				|  |  |                 num=etlList.size();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if(deleteAdminTeam!=null&&deleteAdminTeam.size()>0){
 | 
	
		
			
				|  |  |                 List<ETLModel> deleteEtlList=deleteAdminTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |                 if(deleteEtlList!=null&&deleteEtlList.size()>0){
 | 
	
		
			
				|  |  |                     num=num-deleteEtlList.size();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |             jo.put("num", num);
 | 
	
		
			
				|  |  |             jo.put("teamName", adminTeamObj.getName());
 | 
	
		
			
				|  |  |             jo.put("teamId", adminTeamObj.getId());
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":1:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel1Org(String wlyyQuotaId, Map<String, Hospital> hospitalsMap, Map<String, List<ETLModel>> orgTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Hospital> entry:hospitalsMap.entrySet()){
 | 
	
		
			
				|  |  |             Hospital hospital=entry.getValue();
 | 
	
	
		
			
				|  | @ -503,7 +847,51 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":2:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel1Org(String wlyyQuotaId, Map<String, Hospital> hospitalsMap, Map<String, List<ETLModel>> orgTeam, Map<String, List<ETLModel>> deleteOrgTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Hospital> entry:hospitalsMap.entrySet()){
 | 
	
		
			
				|  |  |             Hospital hospital=entry.getValue();
 | 
	
		
			
				|  |  |             if(hospital==null)continue;
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |             Integer num=0;
 | 
	
		
			
				|  |  |             List<ETLModel> etlList=orgTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |             if(etlList!=null&&etlList.size()>0){
 | 
	
		
			
				|  |  |                 num=etlList.size();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if(deleteOrgTeam!=null&&deleteOrgTeam.size()>0){
 | 
	
		
			
				|  |  |                 List<ETLModel> deleteEtlList=deleteOrgTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |                 if(deleteEtlList!=null&&deleteEtlList.size()>0){
 | 
	
		
			
				|  |  |                     num=num-deleteEtlList.size();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |             jo.put("num", num);
 | 
	
		
			
				|  |  |             jo.put("orgName", hospital.getName());
 | 
	
		
			
				|  |  |             jo.put("orgCode", hospital.getCode());
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":2:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel1Town(String wlyyQuotaId, Map<String, Town> townsMap, Map<String, List<ETLModel>> townTeam, Map<String, List<ETLModel>> deleteTownTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Town> entry:townsMap.entrySet()){
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |             Integer num=0;
 | 
	
		
			
				|  |  |             List<ETLModel> etlList=townTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |             if(etlList!=null&&etlList.size()>0){
 | 
	
		
			
				|  |  |                 num=etlList.size();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if(deleteTownTeam!=null&&deleteTownTeam.size()>0){
 | 
	
		
			
				|  |  |                 List<ETLModel> deleteEtlList=deleteTownTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |                 if(deleteEtlList!=null&&deleteEtlList.size()>0){
 | 
	
		
			
				|  |  |                     num=num-deleteEtlList.size();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |             jo.put("num", num);
 | 
	
		
			
				|  |  |             jo.put("townName", entry.getValue().getName());
 | 
	
		
			
				|  |  |             jo.put("townCode", entry.getValue().getCode());
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":3:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel1Town(String wlyyQuotaId, Map<String, Town> townsMap, Map<String, List<ETLModel>> townTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,Town> entry:townsMap.entrySet()){
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
	
		
			
				|  | @ -519,7 +907,27 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":3:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private void saveLevel1City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, List<ETLModel>> cityTeam, Map<String, List<ETLModel>> deleteCityTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,City> entry:cityMap.entrySet()){
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
		
			
				|  |  |             Integer num=0;
 | 
	
		
			
				|  |  |             List<ETLModel> etlList=cityTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |             if(etlList!=null&&etlList.size()>0){
 | 
	
		
			
				|  |  |                 num=etlList.size();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if(deleteCityTeam!=null&&deleteCityTeam.size()>0){
 | 
	
		
			
				|  |  |             List<ETLModel> deleteEtlList=deleteCityTeam.get(entry.getKey());
 | 
	
		
			
				|  |  |                 if(deleteEtlList!=null&&deleteEtlList.size()>0){
 | 
	
		
			
				|  |  |                     num=num-deleteEtlList.size();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             jo.put("date", DateUtil.dateToStrLong(new Date()));
 | 
	
		
			
				|  |  |             jo.put("num", num);
 | 
	
		
			
				|  |  |             jo.put("cityName", entry.getValue().getName());
 | 
	
		
			
				|  |  |             jo.put("cityCode", entry.getValue().getCode());
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":4:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     private void saveLevel1City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, List<ETLModel>> cityTeam) {
 | 
	
		
			
				|  |  |         for(Map.Entry<String,City> entry:cityMap.entrySet()){
 | 
	
		
			
				|  |  |             JSONObject jo=new JSONObject();
 | 
	
	
		
			
				|  | @ -535,7 +943,6 @@ public class RedisStorage {
 | 
	
		
			
				|  |  |             redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":4:"+entry.getKey()).toString(), jo.toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private String getLevel2Name(String i, Integer type) {
 | 
	
		
			
				|  |  |         switch (type){
 | 
	
		
			
				|  |  |             case  1:{
 |