|
@ -2742,4 +2742,67 @@ public class StatisticsESService {
|
|
|
List<SaveModel> outData = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"35","2",interval+"");
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param level 等级
|
|
|
* @param area 等级编码
|
|
|
* @param disease 疾病编码
|
|
|
* @param type 类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> getPrescriptionTotalHistogram(int level,String area,String disease,String type) throws Exception{
|
|
|
String index ="60";
|
|
|
List<Map<String,Object>> rs =new ArrayList<>();
|
|
|
|
|
|
Calendar dd = Calendar.getInstance();//定义日期实例
|
|
|
Date endDate = new Date();
|
|
|
dd.setTime(endDate);
|
|
|
|
|
|
for(int i=1;i<7;i++){
|
|
|
Map<String,Object> mc = new HashedMap();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
String date = sdf.format(dd.getTime());
|
|
|
mc.put("month",date);
|
|
|
mc.put("count",0);
|
|
|
dd.add(Calendar.MONTH,-1);
|
|
|
rs.add(mc);
|
|
|
}
|
|
|
String startTime = DateUtil.dateToStr(dd.getTime(),"YYYY-MM-dd HH:mm:ss");
|
|
|
String endTime = DateUtil.dateToStr(new Date(),"YYYY-MM-dd HH:mm:ss");
|
|
|
List<SaveModel> resultList = new ArrayList<>();
|
|
|
//类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消
|
|
|
if("1".equals(type)){
|
|
|
//总数
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel1(null,null,area,level,index,"2","3",disease);
|
|
|
}else if("2".equals(type)){
|
|
|
//进行中
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"1");
|
|
|
}else if("3".equals(type)){
|
|
|
//已完成
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"2");
|
|
|
}else if("4".equals(type)){
|
|
|
//已经取消
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"3");
|
|
|
}else if("5".equals(type)){
|
|
|
//审核不通过
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"4");
|
|
|
}else if("6".equals(type)){
|
|
|
//其他原因取消
|
|
|
resultList = elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"5");
|
|
|
}
|
|
|
|
|
|
for(Map<String,Object> m:rs){
|
|
|
Iterator iterator = resultList.iterator();
|
|
|
while (iterator.hasNext()){
|
|
|
SaveModel saveModel = (SaveModel)iterator.next();
|
|
|
String monthKey = (String)m.get("month");
|
|
|
String monthKeyEs = DateUtil.changeQuotaDate(saveModel.getQuotaDate());
|
|
|
if(monthKey.equals(monthKeyEs)){
|
|
|
m.put("count",saveModel.getResult2());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
}
|