|
@ -211,9 +211,10 @@ public class DBStorage {
|
|
|
* @param wlyyQuota
|
|
|
* @param foreachNum2 标识二级维度循环的次数 例如 年龄就传6 性别就传3
|
|
|
* @param foreachNum3 标识三级维度循环的次数 例如 年龄就传6 性别就传3
|
|
|
* @param type 1 性别 2 年龄 3 用户分组 4.签约费用 5
|
|
|
* @param type2 1性别 2年龄 3用户分组 4.签约费用 5健康服务 6年龄2
|
|
|
* @param type3 1 疾病分组
|
|
|
*/
|
|
|
public void saveByLevel3(List<Map<String, Map<String, Map<String, List<ETLModel>>>>> data, String day, WlyyQuotaVO wlyyQuota,Integer foreachNum2,Integer foreachNum3,Integer type) throws Exception{
|
|
|
public void saveByLevel3(List<Map<String, Map<String, Map<String, List<ETLModel>>>>> data, String day, WlyyQuotaVO wlyyQuota,Integer foreachNum2,Integer foreachNum3,Integer type2,Integer type3) throws Exception{
|
|
|
Integer start2=1;
|
|
|
Integer start3=1;
|
|
|
this.wlyyQuota=wlyyQuota;
|
|
@ -238,13 +239,13 @@ public class DBStorage {
|
|
|
Map<String, City> cityMap = new HashMap<String, City>();
|
|
|
cityMap.put(Constant.city,city);
|
|
|
//保存团队
|
|
|
saveAdminTeamDataLevel3(data.get(0),day,adminTeamMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveAdminTeamDataLevel3(data.get(0),day,adminTeamMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
//保存机构
|
|
|
saveHospitalTeamDataLevel3(data.get(1),day,hospitalsMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveHospitalTeamDataLevel3(data.get(1),day,hospitalsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
//保存区
|
|
|
saveTownTeamDataLevel3(data.get(2),day,townsMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveTownTeamDataLevel3(data.get(2),day,townsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
//保存市
|
|
|
saveCityTeamDataLevel3(data.get(3),day,cityMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveCityTeamDataLevel3(data.get(3),day,cityMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -254,11 +255,12 @@ public class DBStorage {
|
|
|
* @param wlyyQuota
|
|
|
* @param foreachNum2 标识二级维度循环的次数 例如 年龄就传6 性别就传3
|
|
|
* @param foreachNum3 标识三级维度循环的次数 例如 年龄就传6 性别就传3
|
|
|
* @param type 1 性别 2 年龄 3 用户分组 4.签约费用
|
|
|
* @param type2 1 性别 2 年龄 3 用户分组 4.签约费用 5健康服务 6年龄2
|
|
|
* @param type3 1 疾病类型
|
|
|
* @param start2 耳機維度起始位置 默认是1
|
|
|
* @param start3 耳機維度起始位置 默认是1
|
|
|
*/
|
|
|
public void saveByLevel3(List<Map<String, Map<String, Map<String, List<ETLModel>>>>> data, String day, WlyyQuotaVO wlyyQuota,Integer foreachNum2,Integer foreachNum3,Integer type,Integer start2,Integer start3) throws Exception{
|
|
|
public void saveByLevel3(List<Map<String, Map<String, Map<String, List<ETLModel>>>>> data, String day, WlyyQuotaVO wlyyQuota,Integer foreachNum2,Integer foreachNum3,Integer type2,Integer type3,Integer start2,Integer start3) throws Exception{
|
|
|
if(start2==null){
|
|
|
start2=1;
|
|
|
}
|
|
@ -287,18 +289,18 @@ public class DBStorage {
|
|
|
Map<String, City> cityMap = new HashMap<String, City>();
|
|
|
cityMap.put(Constant.city,city);
|
|
|
//保存团队
|
|
|
saveAdminTeamDataLevel3(data.get(0),day,adminTeamMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveAdminTeamDataLevel3(data.get(0),day,adminTeamMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
//保存机构
|
|
|
saveHospitalTeamDataLevel3(data.get(1),day,hospitalsMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveHospitalTeamDataLevel3(data.get(1),day,hospitalsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
//保存区
|
|
|
saveTownTeamDataLevel3(data.get(2),day,townsMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveTownTeamDataLevel3(data.get(2),day,townsMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
//保存市
|
|
|
saveCityTeamDataLevel3(data.get(3),day,cityMap,foreachNum2,foreachNum3,type,start2,start3);
|
|
|
saveCityTeamDataLevel3(data.get(3),day,cityMap,foreachNum2,foreachNum3,type2,type3,start2,start3);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void saveAdminTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, AdminTeam> adminTeamMap, Integer foreachNum2, Integer foreachNum3, Integer type, Integer start2, Integer start3)throws Exception {
|
|
|
private void saveAdminTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, AdminTeam> adminTeamMap, Integer foreachNum2, Integer foreachNum3, Integer type2,Integer type3, Integer start2, Integer start3)throws Exception {
|
|
|
List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
|
|
|
//遍历团队的Map
|
|
|
for(Map.Entry<String,AdminTeam> oneAdminTeam:adminTeamMap.entrySet()){
|
|
@ -335,14 +337,15 @@ public class DBStorage {
|
|
|
String level="1";
|
|
|
String level2=i+"";
|
|
|
String level3=j+"";
|
|
|
String level3Name=getLevel3Name(level3,type);
|
|
|
wlyyQuotaResults.add(save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,null,level3,level3Name,day));
|
|
|
String level2Name=getLevel2Name(level2,type2);
|
|
|
String level3Name=getLevel3Name(level3,type3);
|
|
|
wlyyQuotaResults.add(save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,level2Name,level3,level3Name,day));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
saveAll(wlyyQuotaResults);
|
|
|
}
|
|
|
private void saveHospitalTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, Hospital> hospitalsMap, Integer foreachNum2, Integer foreachNum3, Integer type, Integer start2, Integer start3) throws Exception{
|
|
|
private void saveHospitalTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, Hospital> hospitalsMap, Integer foreachNum2, Integer foreachNum3, Integer type2,Integer type3, Integer start2, Integer start3) throws Exception{
|
|
|
List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
|
|
|
//遍历团队的Map
|
|
|
for(Map.Entry<String,Hospital> oneHospital:hospitalsMap.entrySet()){
|
|
@ -376,14 +379,15 @@ public class DBStorage {
|
|
|
String level="2";
|
|
|
String level2=i+"";
|
|
|
String level3=j+"";
|
|
|
String level3Name=getLevel3Name(level3,type);
|
|
|
wlyyQuotaResults.add( save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,null,level3,level3Name,day));
|
|
|
String level2Name=getLevel2Name(level2,type2);
|
|
|
String level3Name=getLevel3Name(level3,type3);
|
|
|
wlyyQuotaResults.add( save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,level2Name,level3,level3Name,day));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
saveAll(wlyyQuotaResults);
|
|
|
}
|
|
|
private void saveTownTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, Town> townsMap, Integer foreachNum2, Integer foreachNum3, Integer type, Integer start2, Integer start3) throws Exception{
|
|
|
private void saveTownTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, Town> townsMap, Integer foreachNum2, Integer foreachNum3, Integer type2,Integer type3, Integer start2, Integer start3) throws Exception{
|
|
|
List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
|
|
|
//遍历团队的Map
|
|
|
for(Map.Entry<String,Town> oneTownTeam:townsMap.entrySet()){
|
|
@ -417,14 +421,15 @@ public class DBStorage {
|
|
|
String level="3";
|
|
|
String level2=i+"";
|
|
|
String level3=j+"";
|
|
|
String level3Name=getLevel3Name(level3,type);
|
|
|
wlyyQuotaResults.add(save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,null,level3,level3Name,day));
|
|
|
String level2Name=getLevel2Name(level2,type2);
|
|
|
String level3Name=getLevel3Name(level3,type3);
|
|
|
wlyyQuotaResults.add(save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,level2Name,level3,level3Name,day));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
saveAll((wlyyQuotaResults));
|
|
|
}
|
|
|
private void saveCityTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, City> cityMap, Integer foreachNum2, Integer foreachNum3, Integer type, Integer start2, Integer start3) throws Exception{
|
|
|
private void saveCityTeamDataLevel3(Map<String, Map<String, Map<String, List<ETLModel>>>> etlModelMap, String day, Map<String, City> cityMap, Integer foreachNum2, Integer foreachNum3, Integer type2,Integer type3, Integer start2, Integer start3) throws Exception{
|
|
|
List<WlyyQuotaResult> wlyyQuotaResults=new ArrayList<WlyyQuotaResult>();
|
|
|
//遍历团队的Map
|
|
|
for(Map.Entry<String,City> oneCityTeam:cityMap.entrySet()){
|
|
@ -456,8 +461,9 @@ public class DBStorage {
|
|
|
String level="4";
|
|
|
String level2=i+"";
|
|
|
String level3=j+"";
|
|
|
String level3Name=getLevel3Name(level3,type);
|
|
|
wlyyQuotaResults.add(save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,null,level3,level3Name,day));
|
|
|
String level2Name=getLevel2Name(level2,type2);
|
|
|
String level3Name=getLevel3Name(level3,type3);
|
|
|
wlyyQuotaResults.add(save(num, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level,level2,level2Name,level3,level3Name,day));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -801,6 +807,11 @@ public class DBStorage {
|
|
|
//健康分布
|
|
|
return Constant.getlevelHealthFbName(i);
|
|
|
}
|
|
|
|
|
|
case 6:{
|
|
|
//年龄2
|
|
|
return Constant.getLevelAge2(i);
|
|
|
}
|
|
|
default:{
|
|
|
return "";
|
|
|
}
|