|
@ -2966,7 +2966,7 @@ public class StatisticsESService {
|
|
public List<Map<String, Object>> getPrescriptionAgeLowLevel(String level, String lowlevel, String area, String disease) throws Exception {
|
|
public List<Map<String, Object>> getPrescriptionAgeLowLevel(String level, String lowlevel, String area, String disease) throws Exception {
|
|
|
|
|
|
String quotaDate = elasticsearchUtil.getQuotaTime();
|
|
String quotaDate = elasticsearchUtil.getQuotaTime();
|
|
List<SaveModel> list = elasticsearchUtil.findListDateQuotaLevel1(quotaDate, area, Integer.parseInt(level), "58", "2", lowlevel, disease);
|
|
|
|
|
|
List<SaveModel> list = elasticsearchUtil.findListDateQuotaLevel1(quotaDate, area, Integer.parseInt(level), "63", "2", lowlevel, disease);
|
|
Map<String, Object> map = null;
|
|
Map<String, Object> map = null;
|
|
List<Map<String, Object>> rs = new ArrayList<>();
|
|
List<Map<String, Object>> rs = new ArrayList<>();
|
|
if (list.size() > 0) {
|
|
if (list.size() > 0) {
|
|
@ -3062,18 +3062,28 @@ public class StatisticsESService {
|
|
Long num = (Long) count.get("num");
|
|
Long num = (Long) count.get("num");
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");//构造方法的字符格式这里如果小数不足2位,会以0补足.
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");//构造方法的字符格式这里如果小数不足2位,会以0补足.
|
|
Double ageRate = list.get(0).getResult2() / num;
|
|
|
|
map.put("0ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(1).getResult2() / num;
|
|
|
|
map.put("7ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(2).getResult2() / num;
|
|
|
|
map.put("19ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(3).getResult2() / num;
|
|
|
|
map.put("31ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(4).getResult2() / num;
|
|
|
|
map.put("51ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(5).getResult2() / num;
|
|
|
|
map.put("65ageRate", decimalFormat.format(ageRate));
|
|
|
|
|
|
if(num==0){
|
|
|
|
map.put("0ageRate", 0.0);
|
|
|
|
map.put("7ageRate", 0.0);
|
|
|
|
map.put("19ageRate", 0.0);
|
|
|
|
map.put("31ageRate", 0.0);
|
|
|
|
map.put("51ageRate", 0.0);
|
|
|
|
map.put("65ageRate", 0.0);
|
|
|
|
}else{
|
|
|
|
|
|
|
|
Double ageRate = list.get(0).getResult2() / num;
|
|
|
|
map.put("0ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(1).getResult2() / num;
|
|
|
|
map.put("7ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(2).getResult2() / num;
|
|
|
|
map.put("19ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(3).getResult2() / num;
|
|
|
|
map.put("31ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(4).getResult2() / num;
|
|
|
|
map.put("51ageRate", decimalFormat.format(ageRate));
|
|
|
|
ageRate = list.get(5).getResult2() / num;
|
|
|
|
map.put("65ageRate", decimalFormat.format(ageRate));
|
|
|
|
}
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@ -3288,13 +3298,14 @@ public class StatisticsESService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Map<String, Object> getPrescriptionAgeTotal(String level, String area, String disease) throws Exception {
|
|
public Map<String, Object> getPrescriptionAgeTotal(String level, String area, String disease) throws Exception {
|
|
|
|
|
|
|
|
//统计长处方总数疾病和状态维度(去重相同患者)
|
|
|
|
String index ="63";
|
|
String quotaDate = elasticsearchUtil.getQuotaTime();
|
|
String quotaDate = elasticsearchUtil.getQuotaTime();
|
|
//统计年龄分布
|
|
//统计年龄分布
|
|
List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel2(quotaDate, area, Integer.parseInt(level), "60", "2", disease);
|
|
|
|
|
|
List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel2(quotaDate, area, Integer.parseInt(level), index, "2", disease);
|
|
|
|
|
|
//总数量
|
|
//总数量
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, area, Integer.parseInt(level), "60", "2");
|
|
|
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, area, Integer.parseInt(level), index, "2");
|
|
|
|
|
|
Double num = saveModel.getResult2();
|
|
Double num = saveModel.getResult2();
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
@ -3324,44 +3335,46 @@ public class StatisticsESService {
|
|
}
|
|
}
|
|
|
|
|
|
public Map<String, Object> getPrescriptionDispatchingTotal(int level, String area, String disease) throws Exception {
|
|
public Map<String, Object> getPrescriptionDispatchingTotal(int level, String area, String disease) throws Exception {
|
|
List<SaveModel> seltList = null;//自取集合
|
|
|
|
List<SaveModel> deliveryList = null;//物流配送集合
|
|
|
|
List<SaveModel> healthDoctorList = null;//健管师配送集合
|
|
|
|
|
|
String index = "62";
|
|
|
|
SaveModel selt = null;//自取集合
|
|
|
|
SaveModel delivery = null;//物流配送集合
|
|
|
|
SaveModel healthDoctor = null;//健管师配送集合
|
|
String quotaTime = elasticsearchUtil.getQuotaTime();
|
|
String quotaTime = elasticsearchUtil.getQuotaTime();
|
|
|
|
//type二级指标,disease一级指标
|
|
if (StringUtils.isNotBlank(disease)) {
|
|
if (StringUtils.isNotBlank(disease)) {
|
|
//自取
|
|
//自取
|
|
seltList = elasticsearchUtil.findListDateQuotaLevel2(quotaTime, area, level, "62", "2", "", "1", disease);
|
|
|
|
|
|
selt = elasticsearchUtil.findOneDateQuotaLevel2(quotaTime,area, level, index, "2", disease, "1");
|
|
//物流配送
|
|
//物流配送
|
|
deliveryList = elasticsearchUtil.findListDateQuotaLevel2(quotaTime, area, level, "62", "2", "", "2", disease);
|
|
|
|
|
|
delivery = elasticsearchUtil.findOneDateQuotaLevel2(quotaTime,area, level, index, "2", disease, "2");
|
|
//健管师配送
|
|
//健管师配送
|
|
healthDoctorList = elasticsearchUtil.findListDateQuotaLevel2(quotaTime, area, level, "62", "2", "", "2", disease);
|
|
|
|
|
|
healthDoctor = elasticsearchUtil.findOneDateQuotaLevel2(quotaTime,area, level, index, "2", disease, "3");
|
|
} else {
|
|
} else {
|
|
//自取
|
|
//自取
|
|
seltList = elasticsearchUtil.findListDateQuotaLevel1(quotaTime, area, level, "62", "2", "", "1");
|
|
|
|
|
|
selt = elasticsearchUtil.findOneDateQuotaLevel1Key2(quotaTime, area, level, index, "2", "1");
|
|
//物流配送
|
|
//物流配送
|
|
deliveryList = elasticsearchUtil.findListDateQuotaLevel1(quotaTime, area, level, "62", "2", "", "2");
|
|
|
|
|
|
delivery = elasticsearchUtil.findOneDateQuotaLevel1Key2(quotaTime, area, level, index, "2", "2");
|
|
//健管师配送
|
|
//健管师配送
|
|
healthDoctorList = elasticsearchUtil.findListDateQuotaLevel1(quotaTime, area, level, "62", "2", "", "2");
|
|
|
|
|
|
healthDoctor = elasticsearchUtil.findOneDateQuotaLevel1Key2(quotaTime, area, level, index, "2", "3");
|
|
}
|
|
}
|
|
|
|
|
|
Map<String, Object> rs = new HashedMap();
|
|
Map<String, Object> rs = new HashedMap();
|
|
//自取数目
|
|
//自取数目
|
|
if (seltList != null && seltList.size() > 0) {
|
|
|
|
rs.put("seltTotal", seltList.get(0).getResult2());
|
|
|
|
|
|
if (selt != null) {
|
|
|
|
rs.put("seltTotal", selt.getResult2());
|
|
} else {
|
|
} else {
|
|
rs.put("seltTotal", 0);
|
|
rs.put("seltTotal", 0);
|
|
}
|
|
}
|
|
|
|
|
|
//快递配送
|
|
//快递配送
|
|
if (deliveryList != null && deliveryList.size() > 0) {
|
|
|
|
rs.put("deliveryTotal", deliveryList.get(0).getResult2());
|
|
|
|
|
|
if (delivery != null) {
|
|
|
|
rs.put("deliveryTotal", delivery.getResult2());
|
|
} else {
|
|
} else {
|
|
rs.put("deliveryTotal", 0);
|
|
rs.put("deliveryTotal", 0);
|
|
}
|
|
}
|
|
|
|
|
|
//健管师配送
|
|
//健管师配送
|
|
if (healthDoctorList != null && healthDoctorList.size() > 0) {
|
|
|
|
rs.put("doctorTotal", healthDoctorList.get(0).getResult2());
|
|
|
|
|
|
if (healthDoctor != null) {
|
|
|
|
rs.put("doctorTotal", healthDoctor.getResult2());
|
|
} else {
|
|
} else {
|
|
rs.put("doctorTotal", 0);
|
|
rs.put("doctorTotal", 0);
|
|
}
|
|
}
|
|
@ -3397,9 +3410,9 @@ public class StatisticsESService {
|
|
|
|
|
|
List<SaveModel> resultList = new ArrayList<>();
|
|
List<SaveModel> resultList = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(disease)) {
|
|
if (StringUtils.isNotBlank(disease)) {
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, "62", "2", "3", type, disease);
|
|
|
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(startTime, endTime, area, level, "62", "2", "3",disease , type);
|
|
} else {
|
|
} else {
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(startTime, endTime, area, level, "62", "2", "3", type);
|
|
|
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel1Key2(startTime, endTime, area, level, "62", "2", "3", type);
|
|
}
|
|
}
|
|
|
|
|
|
for (Map<String, Object> m : rs) {
|
|
for (Map<String, Object> m : rs) {
|
|
@ -3434,9 +3447,9 @@ public class StatisticsESService {
|
|
List<Map<String, Object>> rs = new ArrayList<>();
|
|
List<Map<String, Object>> rs = new ArrayList<>();
|
|
if (StringUtils.isNotBlank(disease)) {
|
|
if (StringUtils.isNotBlank(disease)) {
|
|
//类型 1.自取,2.快递配送,3.健管师配送
|
|
//类型 1.自取,2.快递配送,3.健管师配送
|
|
saveModels = elasticsearchUtil.findListDateQuotaLevel2(quotaDate, area, level, index, "2", lowlevel, type, disease);
|
|
|
|
|
|
saveModels = elasticsearchUtil.findListDateQuotaLevel2(quotaDate, area, level, index, "2", lowlevel, disease, type);
|
|
} else {
|
|
} else {
|
|
saveModels = elasticsearchUtil.findListDateQuotaLevel1(quotaDate, area, level, index, "2", lowlevel, type);
|
|
|
|
|
|
saveModels = elasticsearchUtil.findListDateQuotaLevel1Key2(quotaDate, area, level, index, "2", lowlevel, type);
|
|
}
|
|
}
|
|
if ("5".equals(lowlevel)) {
|
|
if ("5".equals(lowlevel)) {
|
|
translateTeamLeaderName2(saveModels);
|
|
translateTeamLeaderName2(saveModels);
|
|
@ -3604,7 +3617,14 @@ public class StatisticsESService {
|
|
}
|
|
}
|
|
map = new HashMap<>();
|
|
map = new HashMap<>();
|
|
map.put("avg", avg);
|
|
map.put("avg", avg);
|
|
map.put("date", dateFormat.format(one.getQuotaDate()));
|
|
|
|
|
|
if("1".equals(type)){
|
|
|
|
map.put("date", dateFormat.format(one.getQuotaDate()));
|
|
|
|
|
|
|
|
}else if("2".equals(type)){
|
|
|
|
map.put("date", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
|
}else{
|
|
|
|
map.put("date", DateUtil.getMonth(dateFormat.format(one.getQuotaDate())));
|
|
|
|
}
|
|
countList.add(map);
|
|
countList.add(map);
|
|
}
|
|
}
|
|
return countList;
|
|
return countList;
|