|
@ -1,6 +1,7 @@
|
|
|
package com.yihu.jw.es.service;
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.area.dao.BaseCityDao;
|
|
@ -99,63 +100,64 @@ public class StatisticsEsService {
|
|
|
if (StringUtils.isNotEmpty(level2_type)) {
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[0], SaveModel.timeLevel_DDL, level2_type);
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[1], SaveModel.timeLevel_DDL, level2_type);
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL,level2_type);
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[2] + ",21", SaveModel.timeLevel_DDL, level2_type);
|
|
|
} else {
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[0], SaveModel.timeLevel_DDL);
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[1], SaveModel.timeLevel_DDL);
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL);
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[2] + ",21", SaveModel.timeLevel_DDL);
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
|
String yesterday = DateUtil.getNextDay(endDate, -1);//昨天
|
|
|
String lastDay = DateUtil.getNextDay(endDate, -7);//上周的今天
|
|
|
String weekFirstDay = DateUtil.getMondayOfThisWeek();//周一
|
|
|
String weekLastDay = DateUtil.getSundayOfThisWeek();//周日
|
|
|
JSONArray array = dateTotalStatistics2(weekFirstDay,weekLastDay,area,level,indexes[2]+",21",null,SaveModel.timeLevel_ZL,null);//本周量
|
|
|
JSONArray array = dateTotalStatistics2(weekFirstDay, weekLastDay, area, level, indexes[2] + ",21", null, SaveModel.timeLevel_ZL, null);//本周量
|
|
|
Double prices = 0.0;
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject jsonObject = array.getJSONObject(i);
|
|
|
prices +=jsonObject.getDouble("num");
|
|
|
prices += jsonObject.getDouble("num");
|
|
|
}
|
|
|
Double num = prices/array.size();
|
|
|
Double num = prices / array.size();
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
String str = df.format(num);
|
|
|
object.put("dayPrice",str);//日均收入
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(yesterday, yesterday, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL);
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(lastDay, lastDay, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL);
|
|
|
object.put("outPatientCount",saveModel.getResult2().longValue());//问诊量
|
|
|
object.put("prescriptionCount",saveModel1.getResult2().longValue());//开方量
|
|
|
object.put("priceTotal",saveModel2.getResult1().longValue());//总收入
|
|
|
object.put("priceDayRate",baseEvaluateScoreService.judgeScore(saveModel2.getResult1().doubleValue(),saveModel3.getResult1().doubleValue()));
|
|
|
object.put("priceWeekRate",baseEvaluateScoreService.judgeScore(saveModel2.getResult1().doubleValue(),saveModel4.getResult1().doubleValue()));
|
|
|
String prescriptionRate = getRange(saveModel1.getResult2().intValue(), saveModel.getResult2().intValue(),0);
|
|
|
object.put("prescriptionRate",prescriptionRate);//开方率
|
|
|
String startTime = DateUtil.getStringDateShort()+" 00:00:00";
|
|
|
String endTime = DateUtil.getStringDateShort() +" 23:59:59";
|
|
|
object.put("dayPrice", str);//日均收入
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(yesterday, yesterday, area, level, indexes[2] + ",21", SaveModel.timeLevel_DDL);
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(lastDay, lastDay, area, level, indexes[2] + ",21", SaveModel.timeLevel_DDL);
|
|
|
object.put("outPatientCount", saveModel.getResult2().longValue());//问诊量
|
|
|
object.put("prescriptionCount", saveModel1.getResult2().longValue());//开方量
|
|
|
object.put("priceTotal", saveModel2.getResult1().longValue());//总收入
|
|
|
object.put("priceDayRate", baseEvaluateScoreService.judgeScore(saveModel2.getResult1().doubleValue(), saveModel3.getResult1().doubleValue()));
|
|
|
object.put("priceWeekRate", baseEvaluateScoreService.judgeScore(saveModel2.getResult1().doubleValue(), saveModel4.getResult1().doubleValue()));
|
|
|
String prescriptionRate = getRange(saveModel1.getResult2().intValue(), saveModel.getResult2().intValue(), 0);
|
|
|
object.put("prescriptionRate", prescriptionRate);//开方率
|
|
|
String startTime = DateUtil.getStringDateShort() + " 00:00:00";
|
|
|
String endTime = DateUtil.getStringDateShort() + " 23:59:59";
|
|
|
String sql = "";
|
|
|
if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
|
|
|
sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where o.create_time >= to_date('"+startTime+"','yyyy-mm-dd hh24:mi:ss') and o.create_time <= to_date('"+endTime+"','yyyy-mm-dd hh24:mi:ss')";
|
|
|
}else {
|
|
|
sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
|
|
|
}
|
|
|
if (level==4){
|
|
|
sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
|
|
|
}if (level==2){
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
|
|
|
sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where o.create_time >= to_date('" + startTime + "','yyyy-mm-dd hh24:mi:ss') and o.create_time <= to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
|
|
|
} else {
|
|
|
sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where o.create_time >='" + startTime + "' and o.create_time <='" + endTime + "'";
|
|
|
}
|
|
|
if (level == 4) {
|
|
|
sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.org_code ='" + area + "' and dh.del=1)";
|
|
|
}
|
|
|
if (level == 2) {
|
|
|
sql += " AND 1=1 ";
|
|
|
}else if (level==5){
|
|
|
sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.dept_code ='"+area+"' and dh.del=1)";
|
|
|
}else if (level==6){
|
|
|
sql +=" and o.doctor='"+area+"'";
|
|
|
} else if (level == 5) {
|
|
|
sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.dept_code ='" + area + "' and dh.del=1)";
|
|
|
} else if (level == 6) {
|
|
|
sql += " and o.doctor='" + area + "'";
|
|
|
}
|
|
|
List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
Long count = 0L;
|
|
|
if(rstotal!=null&&rstotal.size()>0){
|
|
|
count =Long.parseLong(rstotal.get(0).get("total").toString()) ;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
count = Long.parseLong(rstotal.get(0).get("total").toString());
|
|
|
}
|
|
|
object.put("todayOutPatientCount",count);//今日问诊量
|
|
|
object.put("todayOutPatientCount", count);//今日问诊量
|
|
|
Map<String, Object> scoreAndPercentage = baseEvaluateScoreService.getScoreAndPercentage(area, level);
|
|
|
object.put("totalAvgScore",scoreAndPercentage.get("totalAvgScore"));//服务总评分
|
|
|
object.put("weekJudge",scoreAndPercentage.get("weekJudge"));//周同比
|
|
|
object.put("dayJudge",scoreAndPercentage.get("dayJudge"));//日环比
|
|
|
object.put("totalAvgScore", scoreAndPercentage.get("totalAvgScore"));//服务总评分
|
|
|
object.put("weekJudge", scoreAndPercentage.get("weekJudge"));//周同比
|
|
|
object.put("dayJudge", scoreAndPercentage.get("dayJudge"));//日环比
|
|
|
|
|
|
return object;
|
|
|
}
|
|
@ -164,7 +166,6 @@ public class StatisticsEsService {
|
|
|
/**
|
|
|
* 按日期柱状图
|
|
|
*
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -174,58 +175,58 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getOutPatientLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
|
|
|
public JSONObject getOutPatientLine(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:" + index + " and level2_type:" + level2_type + " and level:" + level);
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,"5","1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("specialistData",array1);
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,"12","9",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("topicData",array2);
|
|
|
JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,"14","12",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("synergyData",array3);
|
|
|
JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,"16","16",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("vedioData",array4);
|
|
|
JSONArray array5 = dateTotalStatistics2(startDate,endDate,area,level,"12","1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("twzxData",array5);
|
|
|
JSONArray array6 = dateTotalStatistics2(startDate,endDate,area,level,"16","17",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("spzxData",array6);
|
|
|
}else if (interval==2){
|
|
|
|
|
|
JSONArray array = weekTotalStatistics7(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
JSONArray array1 = weekTotalStatistics7(startDate,endDate,area,level,"5","1",SaveModel.timeLevel_ZL);
|
|
|
object.put("specialistData",array1);
|
|
|
JSONArray array2 = weekTotalStatistics7(startDate,endDate,area,level,"12","9",SaveModel.timeLevel_ZL);
|
|
|
object.put("topicData",array2);
|
|
|
JSONArray array3 = weekTotalStatistics7(startDate,endDate,area,level,"14","12",SaveModel.timeLevel_ZL);
|
|
|
object.put("synergyData",array3);
|
|
|
JSONArray array4 = weekTotalStatistics7(startDate,endDate,area,level,"16","16",SaveModel.timeLevel_ZL);
|
|
|
object.put("vedioData",array4);
|
|
|
JSONArray array5 = weekTotalStatistics7(startDate,endDate,area,level,"12","1",SaveModel.timeLevel_ZL);
|
|
|
object.put("twzxData",array5);
|
|
|
JSONArray array6 = weekTotalStatistics7(startDate,endDate,area,level,"16","17",SaveModel.timeLevel_ZL);
|
|
|
object.put("spzxData",array6);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,"5","1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("specialistData",array1);
|
|
|
JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,"12","9",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("topicData",array2);
|
|
|
JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,"14","12",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("synergyData",array3);
|
|
|
JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,"16","16",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("vedioData",array4);
|
|
|
JSONArray array5 = monthTotalStatistics2(startDate,endDate,area,level,"12","1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("twzxData",array5);
|
|
|
JSONArray array6 = monthTotalStatistics2(startDate,endDate,area,level,"16","17",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("spzxData",array6);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(level2_type)){
|
|
|
if (interval == 1) {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate, endDate, area, level, "5", "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("specialistData", array1);
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate, endDate, area, level, "12", "9", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("topicData", array2);
|
|
|
JSONArray array3 = dateTotalStatistics2(startDate, endDate, area, level, "14", "12", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("synergyData", array3);
|
|
|
JSONArray array4 = dateTotalStatistics2(startDate, endDate, area, level, "16", "16", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("vedioData", array4);
|
|
|
JSONArray array5 = dateTotalStatistics2(startDate, endDate, area, level, "12", "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("twzxData", array5);
|
|
|
JSONArray array6 = dateTotalStatistics2(startDate, endDate, area, level, "16", "17", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("spzxData", array6);
|
|
|
} else if (interval == 2) {
|
|
|
|
|
|
JSONArray array = weekTotalStatistics7(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
JSONArray array1 = weekTotalStatistics7(startDate, endDate, area, level, "5", "1", SaveModel.timeLevel_ZL);
|
|
|
object.put("specialistData", array1);
|
|
|
JSONArray array2 = weekTotalStatistics7(startDate, endDate, area, level, "12", "9", SaveModel.timeLevel_ZL);
|
|
|
object.put("topicData", array2);
|
|
|
JSONArray array3 = weekTotalStatistics7(startDate, endDate, area, level, "14", "12", SaveModel.timeLevel_ZL);
|
|
|
object.put("synergyData", array3);
|
|
|
JSONArray array4 = weekTotalStatistics7(startDate, endDate, area, level, "16", "16", SaveModel.timeLevel_ZL);
|
|
|
object.put("vedioData", array4);
|
|
|
JSONArray array5 = weekTotalStatistics7(startDate, endDate, area, level, "12", "1", SaveModel.timeLevel_ZL);
|
|
|
object.put("twzxData", array5);
|
|
|
JSONArray array6 = weekTotalStatistics7(startDate, endDate, area, level, "16", "17", SaveModel.timeLevel_ZL);
|
|
|
object.put("spzxData", array6);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate, endDate, area, level, "5", "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("specialistData", array1);
|
|
|
JSONArray array2 = monthTotalStatistics2(startDate, endDate, area, level, "12", "9", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("topicData", array2);
|
|
|
JSONArray array3 = monthTotalStatistics2(startDate, endDate, area, level, "14", "12", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("synergyData", array3);
|
|
|
JSONArray array4 = monthTotalStatistics2(startDate, endDate, area, level, "16", "16", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("vedioData", array4);
|
|
|
JSONArray array5 = monthTotalStatistics2(startDate, endDate, area, level, "12", "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("twzxData", array5);
|
|
|
JSONArray array6 = monthTotalStatistics2(startDate, endDate, area, level, "16", "17", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("spzxData", array6);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(level2_type)) {
|
|
|
|
|
|
//问诊量表格
|
|
|
//专家咨询数量
|
|
@ -233,47 +234,47 @@ public class StatisticsEsService {
|
|
|
List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,null,level2_type);
|
|
|
*/
|
|
|
//协同门诊
|
|
|
List<SaveModel> syngySaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL,"12",null,level2_type);
|
|
|
List<SaveModel> syngySaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL, "12", null, level2_type);
|
|
|
//图文复诊
|
|
|
List<SaveModel> topicSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL,"9",null,level2_type);
|
|
|
List<SaveModel> topicSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "9", null, level2_type);
|
|
|
///视频复诊
|
|
|
List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL,"16",null,level2_type);
|
|
|
List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "16", null, level2_type);
|
|
|
///图文咨询
|
|
|
List<SaveModel> twzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL,"1",null,level2_type);
|
|
|
List<SaveModel> twzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "1", null, level2_type);
|
|
|
///视频咨询
|
|
|
List<SaveModel> spzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL,"17",null,level2_type);
|
|
|
List<SaveModel> spzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "17", null, level2_type);
|
|
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
for (SaveModel saveModel:syngySaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())){
|
|
|
for (SaveModel saveModel : syngySaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())) {
|
|
|
list.add(saveModel.getHospital());
|
|
|
}
|
|
|
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())){
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())) {
|
|
|
list.add(saveModel.getDept());
|
|
|
}
|
|
|
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())) {
|
|
|
list.add(saveModel.getDoctor());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
for (int i=0;i<list.size();i++){
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
String code = list.get(i);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
Double specialist = 0.0;
|
|
|
Double topic = 0.0;
|
|
|
Double vedio =0.0;
|
|
|
Double synegy =0.0;
|
|
|
Double topicZJ =0.0;
|
|
|
Double vedio = 0.0;
|
|
|
Double synegy = 0.0;
|
|
|
Double topicZJ = 0.0;
|
|
|
Double vedioZJ = 0.0;
|
|
|
if (index.equalsIgnoreCase("3")){
|
|
|
if (index.equalsIgnoreCase("3")) {
|
|
|
specialist = 0.0;
|
|
|
}/*else if (index.equalsIgnoreCase("5")){
|
|
|
for (SaveModel saveModel:specialistSaveModels){
|
|
@ -325,346 +326,346 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
for (SaveModel saveModel:syngySaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("synegy",saveModel.getResult1());
|
|
|
for (SaveModel saveModel : syngySaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("synegy", saveModel.getResult1());
|
|
|
synegy = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("synegy",saveModel.getResult1());
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("synegy", saveModel.getResult1());
|
|
|
synegy = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("synegy",saveModel.getResult1());
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("synegy", saveModel.getResult1());
|
|
|
synegy = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:topicSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("topic",saveModel.getResult1());
|
|
|
for (SaveModel saveModel : topicSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("topic", saveModel.getResult1());
|
|
|
topic = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("topic",saveModel.getResult1());
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("topic", saveModel.getResult1());
|
|
|
topic = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("topic",saveModel.getResult1());
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("topic", saveModel.getResult1());
|
|
|
topic = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:vedioSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("vedio",saveModel.getResult1());
|
|
|
for (SaveModel saveModel : vedioSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("vedio", saveModel.getResult1());
|
|
|
vedio = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("vedio",saveModel.getResult1());
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("vedio", saveModel.getResult1());
|
|
|
vedio = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("vedio",saveModel.getResult1());
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("vedio", saveModel.getResult1());
|
|
|
vedio = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:twzxSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("topicZJ",saveModel.getResult1());
|
|
|
for (SaveModel saveModel : twzxSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("topicZJ", saveModel.getResult1());
|
|
|
topicZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("topicZJ",saveModel.getResult1());
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("topicZJ", saveModel.getResult1());
|
|
|
topicZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("topicZJ",saveModel.getResult1());
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("topicZJ", saveModel.getResult1());
|
|
|
topicZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:spzxSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("vedioZJ",saveModel.getResult1());
|
|
|
for (SaveModel saveModel : spzxSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("vedioZJ", saveModel.getResult1());
|
|
|
vedioZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("vedioZJ",saveModel.getResult1());
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("vedioZJ", saveModel.getResult1());
|
|
|
vedioZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("vedioZJ",saveModel.getResult1());
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("vedioZJ", saveModel.getResult1());
|
|
|
vedioZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Double total1 = topic+vedio ;//图文和视频总和
|
|
|
Double total = topic+vedio+synegy+specialist+topicZJ+vedioZJ;//总和
|
|
|
Double total2 = topicZJ+vedioZJ ;//图文咨询和视频咨询总和
|
|
|
jsonObject.put("total1",total1);//图文和视频总和
|
|
|
jsonObject.put("total",total);//总和
|
|
|
jsonObject.put("total2",total2);//图文咨询和视频咨询总和
|
|
|
Double total1 = topic + vedio;//图文和视频总和
|
|
|
Double total = topic + vedio + synegy + specialist + topicZJ + vedioZJ;//总和
|
|
|
Double total2 = topicZJ + vedioZJ;//图文咨询和视频咨询总和
|
|
|
jsonObject.put("total1", total1);//图文和视频总和
|
|
|
jsonObject.put("total", total);//总和
|
|
|
jsonObject.put("total2", total2);//图文咨询和视频咨询总和
|
|
|
array.add(jsonObject);
|
|
|
}
|
|
|
object.put("excelData",array);
|
|
|
object.put("excelData", array);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getOutPatientPriceLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
|
|
|
public JSONObject getOutPatientPriceLine(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:" + index + " and level2_type:" + level2_type + " and level:" + level);
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
JSONArray array1 = dateTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("specialistData",array1);
|
|
|
JSONArray array2 = dateTotalStatistics3(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("topicData",array2);
|
|
|
JSONArray array3 = dateTotalStatistics3(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("synergyData",array3);
|
|
|
JSONArray array4 = dateTotalStatistics3(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("vedioData",array4);
|
|
|
JSONArray array5 = dateTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("twzxData",array5);
|
|
|
JSONArray array6 = dateTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("spzxData",array6);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics7(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
JSONArray array1 = weekTotalStatistics8(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("specialistData",array1);
|
|
|
JSONArray array2 = weekTotalStatistics8(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("topicData",array2);
|
|
|
JSONArray array3 = weekTotalStatistics8(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("synergyData",array3);
|
|
|
JSONArray array4 = weekTotalStatistics8(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("vedioData",array4);
|
|
|
JSONArray array5 = weekTotalStatistics8(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("twzxData",array5);
|
|
|
JSONArray array6 = weekTotalStatistics8(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("spzxData",array6);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
JSONArray array1 = monthTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("specialistData",array1);
|
|
|
JSONArray array2 = monthTotalStatistics3(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("topicData",array2);
|
|
|
JSONArray array3 = monthTotalStatistics3(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("synergyData",array3);
|
|
|
JSONArray array4 = monthTotalStatistics3(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("vedioData",array4);
|
|
|
JSONArray array5 = monthTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("twzxData",array5);
|
|
|
JSONArray array6 = monthTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("spzxData",array6);
|
|
|
if (interval == 1) {
|
|
|
JSONArray array = dateTotalStatistics3(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
JSONArray array1 = dateTotalStatistics3(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("specialistData", array1);
|
|
|
JSONArray array2 = dateTotalStatistics3(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("topicData", array2);
|
|
|
JSONArray array3 = dateTotalStatistics3(startDate, endDate, area, level, index, "2", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("synergyData", array3);
|
|
|
JSONArray array4 = dateTotalStatistics3(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("vedioData", array4);
|
|
|
JSONArray array5 = dateTotalStatistics3(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("twzxData", array5);
|
|
|
JSONArray array6 = dateTotalStatistics3(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("spzxData", array6);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics7(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
JSONArray array1 = weekTotalStatistics8(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("specialistData", array1);
|
|
|
JSONArray array2 = weekTotalStatistics8(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("topicData", array2);
|
|
|
JSONArray array3 = weekTotalStatistics8(startDate, endDate, area, level, index, "2", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("synergyData", array3);
|
|
|
JSONArray array4 = weekTotalStatistics8(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("vedioData", array4);
|
|
|
JSONArray array5 = weekTotalStatistics8(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("twzxData", array5);
|
|
|
JSONArray array6 = weekTotalStatistics8(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("spzxData", array6);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics3(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
JSONArray array1 = monthTotalStatistics3(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("specialistData", array1);
|
|
|
JSONArray array2 = monthTotalStatistics3(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("topicData", array2);
|
|
|
JSONArray array3 = monthTotalStatistics3(startDate, endDate, area, level, index, "2", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("synergyData", array3);
|
|
|
JSONArray array4 = monthTotalStatistics3(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("vedioData", array4);
|
|
|
JSONArray array5 = monthTotalStatistics3(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("twzxData", array5);
|
|
|
JSONArray array6 = monthTotalStatistics3(startDate, endDate, area, level, index, "3", SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("spzxData", array6);
|
|
|
}
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
if (StringUtils.isNoneBlank(level2_type)){
|
|
|
if (StringUtils.isNoneBlank(level2_type)) {
|
|
|
|
|
|
//问诊量表格
|
|
|
//专家咨询数量
|
|
|
List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"3",null,level2_type);
|
|
|
List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", null, level2_type);
|
|
|
//协同门诊
|
|
|
List<SaveModel> syngySaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"2",null,level2_type);
|
|
|
List<SaveModel> syngySaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "2", null, level2_type);
|
|
|
//图文复诊
|
|
|
List<SaveModel> topicSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1","1",null,level2_type);
|
|
|
List<SaveModel> topicSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", "1", null, level2_type);
|
|
|
///视频复诊
|
|
|
List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1","2",null,level2_type);
|
|
|
List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", "2", null, level2_type);
|
|
|
///图文咨询
|
|
|
List<SaveModel> twzxSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"3","1",null,level2_type);
|
|
|
List<SaveModel> twzxSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", "1", null, level2_type);
|
|
|
///视频咨询
|
|
|
List<SaveModel> spzxSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"3","2",null,level2_type);
|
|
|
List<SaveModel> spzxSaveModels = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", "2", null, level2_type);
|
|
|
JSONArray array = new JSONArray();
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
for (SaveModel saveModel:syngySaveModels){
|
|
|
if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())){
|
|
|
for (SaveModel saveModel : syngySaveModels) {
|
|
|
if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())) {
|
|
|
list.add(saveModel.getDept());
|
|
|
}
|
|
|
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())) {
|
|
|
list.add(saveModel.getDoctor());
|
|
|
}
|
|
|
|
|
|
}else if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())){
|
|
|
} else if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())) {
|
|
|
list.add(saveModel.getHospital());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
for (int i=0;i<list.size();i++){
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
String code = list.get(i);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
Double specialist = 0.0;
|
|
|
Double topic = 0.0;
|
|
|
Double vedio =0.0;
|
|
|
Double synegy =0.0;
|
|
|
Double topicZJ =0.0;
|
|
|
Double vedio = 0.0;
|
|
|
Double synegy = 0.0;
|
|
|
Double topicZJ = 0.0;
|
|
|
Double vedioZJ = 0.0;
|
|
|
if (index.equalsIgnoreCase("3")){
|
|
|
if (index.equalsIgnoreCase("3")) {
|
|
|
specialist = 0.0;
|
|
|
jsonObject.put("specialist",specialist);
|
|
|
}else if (index.equalsIgnoreCase("5")){
|
|
|
jsonObject.put("specialist", specialist);
|
|
|
} else if (index.equalsIgnoreCase("5")) {
|
|
|
/* for (SaveModel saveModel:specialistSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
@ -721,279 +722,279 @@ public class StatisticsEsService {
|
|
|
}*/
|
|
|
}
|
|
|
|
|
|
for (SaveModel saveModel:syngySaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
|
|
|
for (SaveModel saveModel : syngySaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("synegy", decimalFormat.format(saveModel.getResult1()));
|
|
|
synegy = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("synegy", decimalFormat.format(saveModel.getResult1()));
|
|
|
synegy = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else if (level==4){
|
|
|
} else if (level == 4) {
|
|
|
BaseOrgDO orgDO = orgDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",orgDO.getName());
|
|
|
}else if (level==2){
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name","厦门市");
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", orgDO.getName());
|
|
|
} else if (level == 2) {
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", "厦门市");
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("synegy", decimalFormat.format(saveModel.getResult1()));
|
|
|
synegy = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:topicSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
|
|
|
for (SaveModel saveModel : topicSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("topic", decimalFormat.format(saveModel.getResult1()));
|
|
|
topic = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("topic", decimalFormat.format(saveModel.getResult1()));
|
|
|
topic = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else if (level==4){
|
|
|
} else if (level == 4) {
|
|
|
BaseOrgDO orgDO = orgDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",orgDO.getName());
|
|
|
}else if (level==2){
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name","厦门市");
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", orgDO.getName());
|
|
|
} else if (level == 2) {
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", "厦门市");
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("topic", decimalFormat.format(saveModel.getResult1()));
|
|
|
topic = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:vedioSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
|
|
|
for (SaveModel saveModel : vedioSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("vedio", decimalFormat.format(saveModel.getResult1()));
|
|
|
vedio = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("vedio", decimalFormat.format(saveModel.getResult1()));
|
|
|
vedio = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else if (level==4){
|
|
|
} else if (level == 4) {
|
|
|
BaseOrgDO orgDO = orgDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",orgDO.getName());
|
|
|
}else if (level==2){
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name","厦门市");
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", orgDO.getName());
|
|
|
} else if (level == 2) {
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", "厦门市");
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("vedio", decimalFormat.format(saveModel.getResult1()));
|
|
|
vedio = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:twzxSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("topicZJ",decimalFormat.format(saveModel.getResult1()));
|
|
|
for (SaveModel saveModel : twzxSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("topicZJ", decimalFormat.format(saveModel.getResult1()));
|
|
|
topicZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("topicZJ",decimalFormat.format(saveModel.getResult1()));
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("topicZJ", decimalFormat.format(saveModel.getResult1()));
|
|
|
topicZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else if (level==4){
|
|
|
} else if (level == 4) {
|
|
|
BaseOrgDO orgDO = orgDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",orgDO.getName());
|
|
|
}else if (level==2){
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name","厦门市");
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", orgDO.getName());
|
|
|
} else if (level == 2) {
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", "厦门市");
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("topicZJ",decimalFormat.format(saveModel.getResult1()));
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("topicZJ", decimalFormat.format(saveModel.getResult1()));
|
|
|
topicZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:spzxSaveModels){
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getHospitalName());
|
|
|
jsonObject.put("vedioZJ",decimalFormat.format(saveModel.getResult1()));
|
|
|
for (SaveModel saveModel : spzxSaveModels) {
|
|
|
if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getHospital()) && code.equalsIgnoreCase(saveModel.getHospital())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("vedioZJ", decimalFormat.format(saveModel.getResult1()));
|
|
|
vedioZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("name",saveModel.getDeptName());
|
|
|
jsonObject.put("vedioZJ",decimalFormat.format(saveModel.getResult1()));
|
|
|
} else if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && code.equalsIgnoreCase(saveModel.getDept())) {
|
|
|
jsonObject.put("code", code);
|
|
|
jsonObject.put("name", saveModel.getDeptName());
|
|
|
jsonObject.put("vedioZJ", decimalFormat.format(saveModel.getResult1()));
|
|
|
vedioZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor())&&code.equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (level==6){
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDoctor()) && code.equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (level == 6) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(area);
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
jsonObject.put("code",doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name",doctorHospitalDO.getDeptName());
|
|
|
jsonObject.put("code", doctorHospitalDO.getDeptCode());
|
|
|
jsonObject.put("name", doctorHospitalDO.getDeptName());
|
|
|
}
|
|
|
}else if (level==4){
|
|
|
} else if (level == 4) {
|
|
|
BaseOrgDO orgDO = orgDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",orgDO.getName());
|
|
|
}else if (level==2){
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name","厦门市");
|
|
|
}else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code",area);
|
|
|
jsonObject.put("name",dictHospitalDeptDO.getName());
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", orgDO.getName());
|
|
|
} else if (level == 2) {
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", "厦门市");
|
|
|
} else {
|
|
|
DictHospitalDeptDO dictHospitalDeptDO = hospitalDeptDao.findByCode(area);
|
|
|
jsonObject.put("code", area);
|
|
|
jsonObject.put("name", dictHospitalDeptDO.getName());
|
|
|
}
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
|
|
|
if (doctorDO!=null){
|
|
|
jsonObject.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
}else {
|
|
|
jsonObject.put("doctorJob",null);
|
|
|
if (doctorDO != null) {
|
|
|
jsonObject.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else {
|
|
|
jsonObject.put("doctorJob", null);
|
|
|
}
|
|
|
jsonObject.put("doctorCode",code);
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("vedioZJ",decimalFormat.format(saveModel.getResult1()));
|
|
|
jsonObject.put("doctorCode", code);
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("vedioZJ", decimalFormat.format(saveModel.getResult1()));
|
|
|
vedioZJ = saveModel.getResult1();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Double total1 = topic+vedio ;//图文和视频总和
|
|
|
Double total = topic+vedio+synegy+specialist+topicZJ+vedioZJ;//总和
|
|
|
Double total2 = topicZJ+vedioZJ ;//图文咨询和视频咨询总和
|
|
|
jsonObject.put("total1",decimalFormat.format(total1));//图文和视频总和
|
|
|
jsonObject.put("total",decimalFormat.format(total));//总和
|
|
|
jsonObject.put("total2",decimalFormat.format(total2));//咨询总和
|
|
|
jsonObject.put("topicZJ",decimalFormat.format(topicZJ));//咨询总和
|
|
|
jsonObject.put("vedioZJ",decimalFormat.format(vedioZJ));//咨询总和
|
|
|
Double total1 = topic + vedio;//图文和视频总和
|
|
|
Double total = topic + vedio + synegy + specialist + topicZJ + vedioZJ;//总和
|
|
|
Double total2 = topicZJ + vedioZJ;//图文咨询和视频咨询总和
|
|
|
jsonObject.put("total1", decimalFormat.format(total1));//图文和视频总和
|
|
|
jsonObject.put("total", decimalFormat.format(total));//总和
|
|
|
jsonObject.put("total2", decimalFormat.format(total2));//咨询总和
|
|
|
jsonObject.put("topicZJ", decimalFormat.format(topicZJ));//咨询总和
|
|
|
jsonObject.put("vedioZJ", decimalFormat.format(vedioZJ));//咨询总和
|
|
|
array.add(jsonObject);
|
|
|
}
|
|
|
List<JSONObject> bindArrayResult = JSONArray.parseArray(array.toJSONString(), JSONObject.class);
|
|
|
System.out.println("排序前:"+bindArrayResult);
|
|
|
System.out.println("排序前:" + bindArrayResult);
|
|
|
Collections.sort(bindArrayResult, new Comparator<JSONObject>() {
|
|
|
@Override
|
|
|
public int compare(JSONObject o1, JSONObject o2) {
|
|
@ -1001,14 +1002,14 @@ public class StatisticsEsService {
|
|
|
double b = o2.getDouble("total");
|
|
|
if (a > b) {
|
|
|
return -1;
|
|
|
} else if(a == b) {
|
|
|
} else if (a == b) {
|
|
|
return 0;
|
|
|
} else
|
|
|
return 1;
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = JSONArray.parseArray(bindArrayResult.toString());
|
|
|
object.put("excelData",jsonArray);
|
|
|
object.put("excelData", jsonArray);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
@ -1017,7 +1018,6 @@ public class StatisticsEsService {
|
|
|
/**
|
|
|
* 开方量按日期柱状图
|
|
|
*
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -1027,17 +1027,16 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getPrescriptionLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
public JSONObject getPrescriptionLine(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
//开方量增量曲线
|
|
|
JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("prescriptionLine",array);
|
|
|
JSONArray array = dateTotalStatistics3(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("prescriptionLine", array);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 门诊圆形图
|
|
|
*
|
|
|
* @param startDate
|
|
@ -1052,48 +1051,48 @@ public class StatisticsEsService {
|
|
|
public JSONObject getOutPatientCircular(String startDate, String endDate, String area, int level, String index, String level2_type) throws Exception {
|
|
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (index.equalsIgnoreCase("3")){
|
|
|
if (index.equalsIgnoreCase("3")) {
|
|
|
//协同门诊
|
|
|
SaveModel saveModel1 = null;
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index+",21", SaveModel.timeLevel_DDL, "2");
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index + ",21", SaveModel.timeLevel_DDL, "2");
|
|
|
//图文复诊
|
|
|
SaveModel saveModel2 = null;
|
|
|
//saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index+",21", SaveModel.timeLevel_DDL, "1","1");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index + ",21", SaveModel.timeLevel_DDL, "1", "1");
|
|
|
//视频复诊
|
|
|
SaveModel saveModel3 = null;
|
|
|
/*
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
|
|
|
*/
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index+",21", SaveModel.timeLevel_DDL, "1","2");
|
|
|
Double specialistCount =0.0;
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index + ",21", SaveModel.timeLevel_DDL, "1", "2");
|
|
|
Double specialistCount = 0.0;
|
|
|
//专科咨询
|
|
|
SaveModel saveModel4 = null;
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index+",21", SaveModel.timeLevel_DDL, "3","1");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index + ",21", SaveModel.timeLevel_DDL, "3", "1");
|
|
|
specialistCount = saveModel4.getResult1();//专家咨询数量
|
|
|
//专科视频咨询
|
|
|
Double specialistSPCount =0.0;
|
|
|
Double specialistSPCount = 0.0;
|
|
|
SaveModel saveModel5 = null;
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index+",21", SaveModel.timeLevel_DDL, "3","2");
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index + ",21", SaveModel.timeLevel_DDL, "3", "2");
|
|
|
specialistSPCount = saveModel5.getResult1();//专家咨询视频数量
|
|
|
Double synergyCount = saveModel1.getResult1();//协同门诊数量
|
|
|
Double topicCount = saveModel2.getResult1();//图文复诊数量
|
|
|
Double videoCount = saveModel3.getResult1();//视频复诊数量
|
|
|
Double total = specialistCount+synergyCount+topicCount+videoCount+specialistSPCount;//总量
|
|
|
Double total = specialistCount + synergyCount + topicCount + videoCount + specialistSPCount;//总量
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
object.put("specialistCount",decimalFormat.format(specialistCount));//专家咨询数
|
|
|
object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
|
|
|
object.put("specialistSPCount",decimalFormat.format(specialistSPCount));//专家咨询数
|
|
|
object.put("specialistSPRate",getRange(specialistSPCount.intValue(),total.intValue(),0));
|
|
|
object.put("synergyCount",decimalFormat.format(synergyCount));//专家咨询数
|
|
|
object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
|
|
|
object.put("topicCount",decimalFormat.format(topicCount));//图文复诊数量
|
|
|
object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
|
|
|
object.put("videoCount",decimalFormat.format(videoCount));//视频复诊数量
|
|
|
object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
|
|
|
object.put("total",decimalFormat.format(total));
|
|
|
|
|
|
}else {
|
|
|
object.put("specialistCount", decimalFormat.format(specialistCount));//专家咨询数
|
|
|
object.put("specialistRate", getRange(specialistCount.intValue(), total.intValue(), 0));
|
|
|
object.put("specialistSPCount", decimalFormat.format(specialistSPCount));//专家咨询数
|
|
|
object.put("specialistSPRate", getRange(specialistSPCount.intValue(), total.intValue(), 0));
|
|
|
object.put("synergyCount", decimalFormat.format(synergyCount));//专家咨询数
|
|
|
object.put("synergyRate", getRange(synergyCount.intValue(), total.intValue(), 0));
|
|
|
object.put("topicCount", decimalFormat.format(topicCount));//图文复诊数量
|
|
|
object.put("topicRate", getRange(topicCount.intValue(), total.intValue(), 0));
|
|
|
object.put("videoCount", decimalFormat.format(videoCount));//视频复诊数量
|
|
|
object.put("videoRate", getRange(videoCount.intValue(), total.intValue(), 0));
|
|
|
object.put("total", decimalFormat.format(total));
|
|
|
|
|
|
} else {
|
|
|
//协同门诊
|
|
|
SaveModel saveModel1 = null;
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "12");
|
|
@ -1107,13 +1106,13 @@ public class StatisticsEsService {
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
|
|
|
*/
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "16");
|
|
|
Double specialistCount =0.0;
|
|
|
Double specialistCount = 0.0;
|
|
|
//专科咨询图文
|
|
|
SaveModel saveModel4 = null;
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1");
|
|
|
specialistCount = saveModel4.getResult1();
|
|
|
//专科咨询视频
|
|
|
Double specialistCountSP =0.0;
|
|
|
Double specialistCountSP = 0.0;
|
|
|
SaveModel saveModel5 = null;
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "17");
|
|
|
specialistCountSP = saveModel5.getResult1();//专家咨询数量
|
|
@ -1121,31 +1120,29 @@ public class StatisticsEsService {
|
|
|
Double synergyCount = saveModel1.getResult1();//协同门诊数量
|
|
|
Double topicCount = saveModel2.getResult1();//图文复诊数量
|
|
|
Double videoCount = saveModel3.getResult1();//视频复诊数量
|
|
|
Double total = specialistCount+synergyCount+topicCount+videoCount+specialistCountSP;//总量
|
|
|
object.put("specialistCount",specialistCount);//专家咨询数
|
|
|
object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
|
|
|
object.put("specialistSPCount",specialistCountSP);//专家咨询视频数
|
|
|
object.put("specialistSPRate",getRange(specialistCountSP.intValue(),total.intValue(),0));
|
|
|
object.put("synergyCount",synergyCount);//专家咨询数
|
|
|
object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
|
|
|
object.put("topicCount",topicCount);//图文复诊数量
|
|
|
object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
|
|
|
object.put("videoCount",videoCount);//视频复诊数量
|
|
|
object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
|
|
|
object.put("total",total);
|
|
|
Double total = specialistCount + synergyCount + topicCount + videoCount + specialistCountSP;//总量
|
|
|
object.put("specialistCount", specialistCount);//专家咨询数
|
|
|
object.put("specialistRate", getRange(specialistCount.intValue(), total.intValue(), 0));
|
|
|
object.put("specialistSPCount", specialistCountSP);//专家咨询视频数
|
|
|
object.put("specialistSPRate", getRange(specialistCountSP.intValue(), total.intValue(), 0));
|
|
|
object.put("synergyCount", synergyCount);//专家咨询数
|
|
|
object.put("synergyRate", getRange(synergyCount.intValue(), total.intValue(), 0));
|
|
|
object.put("topicCount", topicCount);//图文复诊数量
|
|
|
object.put("topicRate", getRange(topicCount.intValue(), total.intValue(), 0));
|
|
|
object.put("videoCount", videoCount);//视频复诊数量
|
|
|
object.put("videoRate", getRange(videoCount.intValue(), total.intValue(), 0));
|
|
|
object.put("total", total);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 问诊量统计-等级
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -1164,24 +1161,24 @@ public class StatisticsEsService {
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL);
|
|
|
int total = saveModel1.getResult1().intValue();
|
|
|
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findDateQuotaLevel0(startDate,endDate,area,level,index,SaveModel.timeLevel_ZL,null,level2_type);
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, level2_type);
|
|
|
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
for (SaveModel saveModel:saveModels){
|
|
|
for (SaveModel saveModel : saveModels) {
|
|
|
JSONObject object1 = new JSONObject();
|
|
|
if (level2_type.equals(SaveModel.deptLevel)){
|
|
|
object1.put("dept",saveModel.getDept());
|
|
|
object1.put("deptName",saveModel.getDeptName());
|
|
|
}else if (level2_type.equals(SaveModel.doctorLevel)){
|
|
|
object1.put("doctor",saveModel.getDoctor());
|
|
|
object1.put("doctorName",saveModel.getDoctorName());
|
|
|
}else if (level2_type.equals(SaveModel.OrgLevel)){
|
|
|
object1.put("hospital",saveModel.getHospital());
|
|
|
object1.put("hospitalName",saveModel.getHospitalName());
|
|
|
}
|
|
|
object1.put("result1",saveModel.getResult1());
|
|
|
object1.put("rate",getRange(saveModel.getResult1().intValue(),total,0));
|
|
|
object1.put("result2",saveModel.getResult2());
|
|
|
if (level2_type.equals(SaveModel.deptLevel)) {
|
|
|
object1.put("dept", saveModel.getDept());
|
|
|
object1.put("deptName", saveModel.getDeptName());
|
|
|
} else if (level2_type.equals(SaveModel.doctorLevel)) {
|
|
|
object1.put("doctor", saveModel.getDoctor());
|
|
|
object1.put("doctorName", saveModel.getDoctorName());
|
|
|
} else if (level2_type.equals(SaveModel.OrgLevel)) {
|
|
|
object1.put("hospital", saveModel.getHospital());
|
|
|
object1.put("hospitalName", saveModel.getHospitalName());
|
|
|
}
|
|
|
object1.put("result1", saveModel.getResult1());
|
|
|
object1.put("rate", getRange(saveModel.getResult1().intValue(), total, 0));
|
|
|
object1.put("result2", saveModel.getResult2());
|
|
|
result.add(object1);
|
|
|
}
|
|
|
// 排序
|
|
@ -1198,15 +1195,16 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object2:result){
|
|
|
for (JSONObject object2 : result) {
|
|
|
jsonArray.add(object2);
|
|
|
}
|
|
|
object.put("data",result);
|
|
|
object.put("data", result);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 问诊量统计-类别曲线
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -1219,29 +1217,29 @@ public class StatisticsEsService {
|
|
|
public JSONObject getOutPatientTypeline(String startDate, String endDate, String area, int level, String index, String level2_type) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
//专家咨询
|
|
|
JSONArray specialistArray = dateTotalStatistics2(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("specialistArray",specialistArray);
|
|
|
JSONArray specialistArray = dateTotalStatistics2(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("specialistArray", specialistArray);
|
|
|
//专家咨询
|
|
|
JSONArray specialistSPArray = dateTotalStatistics2(startDate,endDate,area,level,index,"17",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("specialistSPArray",specialistSPArray);
|
|
|
JSONArray specialistSPArray = dateTotalStatistics2(startDate, endDate, area, level, index, "17", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("specialistSPArray", specialistSPArray);
|
|
|
//协同复诊
|
|
|
JSONArray syngeryArray = dateTotalStatistics2(startDate,endDate,area,level,index,"12",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("syngeryArray",syngeryArray);
|
|
|
JSONArray syngeryArray = dateTotalStatistics2(startDate, endDate, area, level, index, "12", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("syngeryArray", syngeryArray);
|
|
|
//图文复诊
|
|
|
JSONArray topicArray = dateTotalStatistics2(startDate,endDate,area,level,index,"9",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("topicArray",topicArray);
|
|
|
JSONArray topicArray = dateTotalStatistics2(startDate, endDate, area, level, index, "9", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("topicArray", topicArray);
|
|
|
//视频复诊
|
|
|
JSONArray vedioArray = dateTotalStatistics2(startDate,endDate,area,level,index,"16",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("vedioArray",vedioArray);
|
|
|
JSONArray vedioArray = dateTotalStatistics2(startDate, endDate, area, level, index, "16", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("vedioArray", vedioArray);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getDoctorStatistics(String startDate, String endDate, String area, int level, String index, String level2_type,Integer flag) throws Exception {
|
|
|
public JSONObject getDoctorStatistics(String startDate, String endDate, String area, int level, String index, String level2_type, Integer flag) throws Exception {
|
|
|
String sql = null;
|
|
|
JSONObject object1= new JSONObject();
|
|
|
if (flag==1){
|
|
|
sql="SELECT dhd.CODE AS \"dept_code\", dhd. NAME AS \"dept_name\", CASE WHEN c. COUNT IS NOT NULL THEN " +
|
|
|
JSONObject object1 = new JSONObject();
|
|
|
if (flag == 1) {
|
|
|
sql = "SELECT dhd.CODE AS \"dept_code\", dhd. NAME AS \"dept_name\", CASE WHEN c. COUNT IS NOT NULL THEN " +
|
|
|
"c. COUNT ELSE 0 END AS \"COUNT\" FROM DICT_HOSPITAL_DEPT dhd " +
|
|
|
"LEFT JOIN ( SELECT dh.DEPT_CODE as\"DEPT_CODE\", hd. NAME AS \"dept_name\", " +
|
|
|
"COUNT(dh.DOCTOR_CODE) AS \"COUNT\" FROM BASE_DOCTOR bd " +
|
|
@ -1251,31 +1249,31 @@ public class StatisticsEsService {
|
|
|
"ORDER BY COUNT DESC ) c ON dhd.CODE = c.DEPT_CODE " +
|
|
|
"WHERE dhd.CONSULT_DEPT_FLAG='1' " +
|
|
|
"ORDER BY count desc";
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (Map<String,Object> map:mapList){
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (array!=null&&array.size()!=0){
|
|
|
JSONObject jsonObject = array.getJSONObject(array.size()-1);
|
|
|
object.put("deptCode",map.get("dept_code"));
|
|
|
object.put("deptName",map.get("dept_name"));
|
|
|
object.put("count",map.get("count"));
|
|
|
if (jsonObject.getInteger("count")==Integer.parseInt(map.get("count").toString())){
|
|
|
object.put("rank",jsonObject.getInteger("rank"));
|
|
|
}else if (jsonObject.getInteger("count")>Integer.parseInt(map.get("count").toString())){
|
|
|
object.put("rank",jsonObject.getInteger("rank")+1);
|
|
|
if (array != null && array.size() != 0) {
|
|
|
JSONObject jsonObject = array.getJSONObject(array.size() - 1);
|
|
|
object.put("deptCode", map.get("dept_code"));
|
|
|
object.put("deptName", map.get("dept_name"));
|
|
|
object.put("count", map.get("count"));
|
|
|
if (jsonObject.getInteger("count") == Integer.parseInt(map.get("count").toString())) {
|
|
|
object.put("rank", jsonObject.getInteger("rank"));
|
|
|
} else if (jsonObject.getInteger("count") > Integer.parseInt(map.get("count").toString())) {
|
|
|
object.put("rank", jsonObject.getInteger("rank") + 1);
|
|
|
}
|
|
|
}else {
|
|
|
object.put("deptCode",map.get("dept_code"));
|
|
|
object.put("deptName",map.get("dept_name"));
|
|
|
object.put("count",map.get("count"));
|
|
|
object.put("rank",1);
|
|
|
} else {
|
|
|
object.put("deptCode", map.get("dept_code"));
|
|
|
object.put("deptName", map.get("dept_name"));
|
|
|
object.put("count", map.get("count"));
|
|
|
object.put("rank", 1);
|
|
|
}
|
|
|
array.add(object);
|
|
|
}
|
|
|
object1.put("data",array);//排名
|
|
|
object1.put("data", array);//排名
|
|
|
|
|
|
}else if (flag ==2) {
|
|
|
} else if (flag == 2) {
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, "6");
|
|
|
String deptSql = "select hd.CODE as \"code\",hd.NAME as \"name\" from DICT_HOSPITAL_DEPT hd where hd.ORG_CODE ='" + area + "' and hd.CONSULT_DEPT_FLAG=1";
|
|
|
List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(deptSql);
|
|
@ -1294,7 +1292,7 @@ public class StatisticsEsService {
|
|
|
object.put("deptName", map.get("name"));
|
|
|
Integer count = 0;
|
|
|
for (SaveModel saveModel : saveModels) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept())&&saveModel.getDept().equalsIgnoreCase(code)) {
|
|
|
if (StringUtils.isNoneBlank(saveModel.getDept()) && saveModel.getDept().equalsIgnoreCase(code)) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
count += 1;
|
|
|
}
|
|
@ -1317,23 +1315,23 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (JSONObject map:result){
|
|
|
for (JSONObject map : result) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (array!=null&&array.size()!=0){
|
|
|
JSONObject jsonObject = array.getJSONObject(array.size()-1);
|
|
|
object.put("deptCode",map.getString("deptCode"));
|
|
|
object.put("deptName",map.getString("deptName"));
|
|
|
object.put("count",map.getInteger("count"));
|
|
|
if (jsonObject.getInteger("count")==map.getInteger("count")){
|
|
|
object.put("rank",jsonObject.getInteger("rank"));
|
|
|
}else if (jsonObject.getInteger("count")>map.getInteger("count")){
|
|
|
object.put("rank",jsonObject.getInteger("rank")+1);
|
|
|
if (array != null && array.size() != 0) {
|
|
|
JSONObject jsonObject = array.getJSONObject(array.size() - 1);
|
|
|
object.put("deptCode", map.getString("deptCode"));
|
|
|
object.put("deptName", map.getString("deptName"));
|
|
|
object.put("count", map.getInteger("count"));
|
|
|
if (jsonObject.getInteger("count") == map.getInteger("count")) {
|
|
|
object.put("rank", jsonObject.getInteger("rank"));
|
|
|
} else if (jsonObject.getInteger("count") > map.getInteger("count")) {
|
|
|
object.put("rank", jsonObject.getInteger("rank") + 1);
|
|
|
}
|
|
|
}else {
|
|
|
object.put("deptCode",map.get("deptCode"));
|
|
|
object.put("deptName",map.get("deptName"));
|
|
|
object.put("count",map.get("count"));
|
|
|
object.put("rank",1);
|
|
|
} else {
|
|
|
object.put("deptCode", map.get("deptCode"));
|
|
|
object.put("deptName", map.get("deptName"));
|
|
|
object.put("count", map.get("count"));
|
|
|
object.put("rank", 1);
|
|
|
}
|
|
|
array.add(object);
|
|
|
}
|
|
@ -1343,70 +1341,70 @@ public class StatisticsEsService {
|
|
|
return object1;
|
|
|
}
|
|
|
|
|
|
public JSONObject getDoctorTotal(String startDate, String endDate, String area, int level, String index, String level2_type,Integer flag) throws Exception {
|
|
|
public JSONObject getDoctorTotal(String startDate, String endDate, String area, int level, String index, String level2_type, Integer flag) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (flag==1){
|
|
|
if (flag == 1) {
|
|
|
String sql = "SELECT bd.JOB_TITLE_CODE as \"JOB_TITLE_CODE\", bd.JOB_TITLE_NAME as \"JOB_TITLE_NAME\", COUNT(bd.ID) as \"count\" FROM " +
|
|
|
"BASE_DOCTOR bd, BASE_DOCTOR_HOSPITAL bdh,DICT_HOSPITAL_DEPT dhd WHERE bd.ID = bdh.DOCTOR_CODE AND dhd.code = bdh.DEPT_CODE AND bd.DEL = 1 " +
|
|
|
" AND bdh.DEL = 1 AND bd.OUTPATIENT_TYPE IS NOT NULL AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065') " ;
|
|
|
" AND bdh.DEL = 1 AND bd.OUTPATIENT_TYPE IS NOT NULL AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065') ";
|
|
|
|
|
|
String sqlCount = "SELECT COUNT(bd.ID) as \"total\" FROM " +
|
|
|
"BASE_DOCTOR bd, BASE_DOCTOR_HOSPITAL bdh,DICT_HOSPITAL_DEPT dhd WHERE bd.ID = bdh.DOCTOR_CODE AND dhd.code = bdh.DEPT_CODE AND bd.DEL = 1 " +
|
|
|
" AND bdh.DEL = 1 AND bd.OUTPATIENT_TYPE IS NOT NULL AND dhd.CONSULT_DEPT_FLAG='1' AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065') ";
|
|
|
|
|
|
if (level==4){
|
|
|
sql+=" AND dhd.ORG_CODE = '"+area+"'";
|
|
|
sqlCount+=" AND dhd.ORG_CODE = '"+area+"'";
|
|
|
}else if (level==5){
|
|
|
sql+=" AND bdh.DEPT_CODE = '"+area+"'";
|
|
|
sqlCount+=" AND bdh.DEPT_CODE = '"+area+"'";
|
|
|
if (level == 4) {
|
|
|
sql += " AND dhd.ORG_CODE = '" + area + "'";
|
|
|
sqlCount += " AND dhd.ORG_CODE = '" + area + "'";
|
|
|
} else if (level == 5) {
|
|
|
sql += " AND bdh.DEPT_CODE = '" + area + "'";
|
|
|
sqlCount += " AND bdh.DEPT_CODE = '" + area + "'";
|
|
|
}
|
|
|
sql += " AND dhd.CONSULT_DEPT_FLAG='1' GROUP BY bd.JOB_TITLE_CODE,bd.JOB_TITLE_NAME";
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);//各职称人数
|
|
|
List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlCount);//总人数
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);//各职称人数
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sqlCount);//总人数
|
|
|
Long total = 0L;
|
|
|
if(rstotal!=null&&rstotal.size()>0){
|
|
|
total = Long.parseLong(rstotal.get(0).get("total").toString()) ;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
total = Long.parseLong(rstotal.get(0).get("total").toString());
|
|
|
}
|
|
|
for (Map<String,Object> map:mapList){
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
Integer count = Integer.parseInt(map.get("count").toString());
|
|
|
map.put("rate",getRange(count,total.intValue(),0));//百分比
|
|
|
map.put("rate", getRange(count, total.intValue(), 0));//百分比
|
|
|
}
|
|
|
object.put("total",total);//总量
|
|
|
object.put("data",mapList);//各职称人数
|
|
|
}else if (flag==2){
|
|
|
object.put("total", total);//总量
|
|
|
object.put("data", mapList);//各职称人数
|
|
|
} else if (flag == 2) {
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, "6");
|
|
|
StringBuffer buffer = new StringBuffer();
|
|
|
int total = 0;
|
|
|
for(SaveModel saveModel:saveModels){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
total+=1;
|
|
|
buffer.append("'"+saveModel.getDoctor()+"',");
|
|
|
for (SaveModel saveModel : saveModels) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
total += 1;
|
|
|
buffer.append("'" + saveModel.getDoctor() + "',");
|
|
|
}
|
|
|
}
|
|
|
if (buffer.length()>0){
|
|
|
buffer.deleteCharAt(buffer.length()-1);
|
|
|
if (buffer.length() > 0) {
|
|
|
buffer.deleteCharAt(buffer.length() - 1);
|
|
|
}
|
|
|
if (buffer.length()>0){
|
|
|
String sql ="SELECT bd.JOB_TITLE_CODE as \"JOB_TITLE_CODE\", bd.JOB_TITLE_NAME as \"JOB_TITLE_NAME\" ,COUNT(bd.ID) AS \"total\" FROM BASE_DOCTOR bd WHERE bd.DEL = 1";
|
|
|
sql +=" AND bd.ID IN("+buffer+")";
|
|
|
sql +=" GROUP BY bd.JOB_TITLE_CODE,bd.JOB_TITLE_NAME";
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);//各职称人数
|
|
|
for (Map<String,Object> map:mapList){
|
|
|
if (buffer.length() > 0) {
|
|
|
String sql = "SELECT bd.JOB_TITLE_CODE as \"JOB_TITLE_CODE\", bd.JOB_TITLE_NAME as \"JOB_TITLE_NAME\" ,COUNT(bd.ID) AS \"total\" FROM BASE_DOCTOR bd WHERE bd.DEL = 1";
|
|
|
sql += " AND bd.ID IN(" + buffer + ")";
|
|
|
sql += " GROUP BY bd.JOB_TITLE_CODE,bd.JOB_TITLE_NAME";
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);//各职称人数
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
Integer count = Integer.parseInt(map.get("total").toString());
|
|
|
map.put("rate",getRange(count,total,0));//百分比
|
|
|
map.put("rate", getRange(count, total, 0));//百分比
|
|
|
}
|
|
|
object.put("total",total);//总量
|
|
|
object.put("data",mapList);//各职称人数
|
|
|
object.put("total", total);//总量
|
|
|
object.put("data", mapList);//各职称人数
|
|
|
}
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
public JSONObject getDoctorStatisticsExcel(String startDate, String endDate, String area, int level, String index, String level2_type,Integer flag) throws Exception {
|
|
|
public JSONObject getDoctorStatisticsExcel(String startDate, String endDate, String area, int level, String index, String level2_type, Integer flag) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (flag==1){//开通医生
|
|
|
String sql ="SELECT bd.ID as\"ID\", bd.NAME as\"NAME\", bd.OUTPATIENT_TYPE as\"OUTPATIENT_TYPE\", " +
|
|
|
if (flag == 1) {//开通医生
|
|
|
String sql = "SELECT bd.ID as\"ID\", bd.NAME as\"NAME\", bd.OUTPATIENT_TYPE as\"OUTPATIENT_TYPE\", " +
|
|
|
"dhd.code AS \"dept_code\", dhd.name AS \"dept_name\",bd.JOB_TITLE_NAME as\"JOB_TITLE_NAME\" FROM " +
|
|
|
"BASE_DOCTOR bd, BASE_DOCTOR_HOSPITAL bdh, " +
|
|
|
"DICT_HOSPITAL_DEPT dhd WHERE bd.ID = bdh.DOCTOR_CODE " +
|
|
@ -1416,276 +1414,276 @@ public class StatisticsEsService {
|
|
|
"AND bd.OUTPATIENT_TYPE IS NOT NULL " +
|
|
|
" AND dhd.CONSULT_DEPT_FLAG='1' AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065','1','2','3','4')";
|
|
|
String deptSql = "select hd.CODE as \"CODE\",hd.NAME as \"NAME\" from DICT_HOSPITAL_DEPT hd where CONSULT_DEPT_FLAG=1";
|
|
|
if (level==4){//科室
|
|
|
sql+=" AND dhd.ORG_CODE = '"+area+"'";
|
|
|
deptSql+=" AND hd.ORG_CODE ='" + area + "'";
|
|
|
}else if (level==5){//医生
|
|
|
sql+=" AND bdh.DEPT_CODE = '"+area+"'";
|
|
|
deptSql+=" AND hd.CODE ='" + area + "'";
|
|
|
}
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
if (level == 4) {//科室
|
|
|
sql += " AND dhd.ORG_CODE = '" + area + "'";
|
|
|
deptSql += " AND hd.ORG_CODE ='" + area + "'";
|
|
|
} else if (level == 5) {//医生
|
|
|
sql += " AND bdh.DEPT_CODE = '" + area + "'";
|
|
|
deptSql += " AND hd.CODE ='" + area + "'";
|
|
|
}
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String, Object>> mapList1 = jdbcTemplate.queryForList(deptSql);
|
|
|
JSONArray array =new JSONArray();
|
|
|
if (level==4){
|
|
|
for (Map<String,Object> map1:mapList1){
|
|
|
JSONArray array = new JSONArray();
|
|
|
if (level == 4) {
|
|
|
for (Map<String, Object> map1 : mapList1) {
|
|
|
JSONObject object1 = new JSONObject();
|
|
|
object1.put("deptCode",map1.get("code"));
|
|
|
object1.put("deptName",map1.get("name"));
|
|
|
object1.put("deptCode", map1.get("code"));
|
|
|
object1.put("deptName", map1.get("name"));
|
|
|
Long topic = 0L;
|
|
|
Long vedio =0L;
|
|
|
Long vedio = 0L;
|
|
|
Long synegy = 0L;
|
|
|
Long specialist =0L;
|
|
|
Long other =0L;
|
|
|
Long specialist = 0L;
|
|
|
Long other = 0L;
|
|
|
Long topicZJ = 0L;
|
|
|
Long vedioZJ =0L;
|
|
|
for (Map<String,Object> map:mapList){
|
|
|
if (map.get("dept_code").toString().equalsIgnoreCase(map1.get("code").toString())){
|
|
|
Long vedioZJ = 0L;
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
if (map.get("dept_code").toString().equalsIgnoreCase(map1.get("code").toString())) {
|
|
|
String outpatientType = map.get("outpatient_type").toString();
|
|
|
String str[]=outpatientType.split(",");
|
|
|
for (int i=0;i<str.length;i++){
|
|
|
if (str[i].contains("1")){
|
|
|
topic+=1;
|
|
|
}else if (str[i].contains("2")){
|
|
|
vedio+=1;
|
|
|
}else if (str[i].contains("xt")){
|
|
|
synegy+=1;
|
|
|
}else if (str[i].contains("zj")){
|
|
|
topicZJ+=1;
|
|
|
} else if (str[i].contains("zxsp")){
|
|
|
vedioZJ+=1;
|
|
|
}else {
|
|
|
other+=1;
|
|
|
String str[] = outpatientType.split(",");
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
if (str[i].contains("1")) {
|
|
|
topic += 1;
|
|
|
} else if (str[i].contains("2")) {
|
|
|
vedio += 1;
|
|
|
} else if (str[i].contains("xt")) {
|
|
|
synegy += 1;
|
|
|
} else if (str[i].contains("zj")) {
|
|
|
topicZJ += 1;
|
|
|
} else if (str[i].contains("zxsp")) {
|
|
|
vedioZJ += 1;
|
|
|
} else {
|
|
|
other += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
object1.put("topic",topic);//图文
|
|
|
object1.put("vedio",vedio);//视频
|
|
|
object1.put("topicZJ",topicZJ);//图文
|
|
|
object1.put("vedioZJ",vedioZJ);//视频
|
|
|
object1.put("synegy",synegy);//协同
|
|
|
object1.put("specialist",specialist);//专家
|
|
|
object1.put("other",other);//其他
|
|
|
object1.put("doctorName","-");//医生名字
|
|
|
object1.put("doctorJob","-");//医生职称
|
|
|
object1.put("topic", topic);//图文
|
|
|
object1.put("vedio", vedio);//视频
|
|
|
object1.put("topicZJ", topicZJ);//图文
|
|
|
object1.put("vedioZJ", vedioZJ);//视频
|
|
|
object1.put("synegy", synegy);//协同
|
|
|
object1.put("specialist", specialist);//专家
|
|
|
object1.put("other", other);//其他
|
|
|
object1.put("doctorName", "-");//医生名字
|
|
|
object1.put("doctorJob", "-");//医生职称
|
|
|
array.add(object1);
|
|
|
}
|
|
|
}else if (level==5){
|
|
|
for (Map<String,Object> map:mapList){
|
|
|
} else if (level == 5) {
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
JSONObject object1 = new JSONObject();
|
|
|
object1.put("deptCode",map.get("dept_code"));
|
|
|
object1.put("deptName",map.get("dept_name"));
|
|
|
object1.put("deptCode", map.get("dept_code"));
|
|
|
object1.put("deptName", map.get("dept_name"));
|
|
|
Long topic = 0L;
|
|
|
Long vedio =0L;
|
|
|
Long vedio = 0L;
|
|
|
Long synegy = 0L;
|
|
|
Long specialist =0L;
|
|
|
Long other =0L;
|
|
|
Long specialist = 0L;
|
|
|
Long other = 0L;
|
|
|
Long topicZJ = 0L;
|
|
|
Long vedioZJ =0L;
|
|
|
Long vedioZJ = 0L;
|
|
|
String outpatientType = map.get("outpatient_type").toString();
|
|
|
String str[]=outpatientType.split(",");
|
|
|
for (int i=0;i<str.length;i++){
|
|
|
if (str[i].contains("1")){
|
|
|
topic+=1;
|
|
|
}else if (str[i].contains("2")){
|
|
|
vedio+=1;
|
|
|
}else if (str[i].contains("xt")){
|
|
|
synegy+=1;
|
|
|
}else if (str[i].contains("zj")){
|
|
|
topicZJ+=1;
|
|
|
} else if (str[i].contains("zxsp")){
|
|
|
vedioZJ+=1;
|
|
|
}else {
|
|
|
other+=1;
|
|
|
String str[] = outpatientType.split(",");
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
if (str[i].contains("1")) {
|
|
|
topic += 1;
|
|
|
} else if (str[i].contains("2")) {
|
|
|
vedio += 1;
|
|
|
} else if (str[i].contains("xt")) {
|
|
|
synegy += 1;
|
|
|
} else if (str[i].contains("zj")) {
|
|
|
topicZJ += 1;
|
|
|
} else if (str[i].contains("zxsp")) {
|
|
|
vedioZJ += 1;
|
|
|
} else {
|
|
|
other += 1;
|
|
|
}
|
|
|
}
|
|
|
object1.put("topic",topic);//图文
|
|
|
object1.put("vedio",vedio);//视频
|
|
|
object1.put("topicZJ",topicZJ);//图文
|
|
|
object1.put("vedioZJ",vedioZJ);//视频
|
|
|
object1.put("synegy",synegy);//协同
|
|
|
object1.put("specialist",specialist);//专家
|
|
|
object1.put("other",other);//其他
|
|
|
object1.put("doctor",map.get("id"));
|
|
|
object1.put("doctorName",map.get("name"));//医生名字
|
|
|
object1.put("doctorJob",map.get("job_title_name"));//医生职称
|
|
|
object1.put("topic", topic);//图文
|
|
|
object1.put("vedio", vedio);//视频
|
|
|
object1.put("topicZJ", topicZJ);//图文
|
|
|
object1.put("vedioZJ", vedioZJ);//视频
|
|
|
object1.put("synegy", synegy);//协同
|
|
|
object1.put("specialist", specialist);//专家
|
|
|
object1.put("other", other);//其他
|
|
|
object1.put("doctor", map.get("id"));
|
|
|
object1.put("doctorName", map.get("name"));//医生名字
|
|
|
object1.put("doctorJob", map.get("job_title_name"));//医生职称
|
|
|
array.add(object1);
|
|
|
}
|
|
|
}
|
|
|
object.put("data",array);
|
|
|
}else if (flag==2){//活跃医生
|
|
|
object.put("data", array);
|
|
|
} else if (flag == 2) {//活跃医生
|
|
|
//图文
|
|
|
List<SaveModel> topicModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "9",null, "6");
|
|
|
List<SaveModel> topicModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "9", null, "6");
|
|
|
//视频
|
|
|
List<SaveModel> vedioModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "16",null, "6");
|
|
|
List<SaveModel> vedioModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "16", null, "6");
|
|
|
//协同
|
|
|
List<SaveModel> synegyModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "12",null, "6");
|
|
|
List<SaveModel> synegyModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "12", null, "6");
|
|
|
//专科图文
|
|
|
List<SaveModel> specialistModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level,index, SaveModel.timeLevel_ZL,"1",null, "6");
|
|
|
List<SaveModel> specialistModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", null, "6");
|
|
|
//专科视频
|
|
|
List<SaveModel> specialistSPModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level,index, SaveModel.timeLevel_ZL,"17",null, "6");
|
|
|
List<SaveModel> specialistSPModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "17", null, "6");
|
|
|
|
|
|
String deptSql = "select hd.CODE as \"CODE\",hd.NAME as \"NAME\" from DICT_HOSPITAL_DEPT hd where CONSULT_DEPT_FLAG=1";
|
|
|
if (level==4){//科室
|
|
|
deptSql+=" AND hd.ORG_CODE ='" + area + "'";
|
|
|
}else if (level==5){//医生
|
|
|
deptSql+=" AND hd.CODE ='" + area + "'";
|
|
|
if (level == 4) {//科室
|
|
|
deptSql += " AND hd.ORG_CODE ='" + area + "'";
|
|
|
} else if (level == 5) {//医生
|
|
|
deptSql += " AND hd.CODE ='" + area + "'";
|
|
|
}
|
|
|
List<Map<String, Object>> mapList1 = jdbcTemplate.queryForList(deptSql);
|
|
|
JSONArray array =new JSONArray();
|
|
|
if (level==4){
|
|
|
for (Map<String,Object> map:mapList1){
|
|
|
JSONArray array = new JSONArray();
|
|
|
if (level == 4) {
|
|
|
for (Map<String, Object> map : mapList1) {
|
|
|
Long topic = 0L;
|
|
|
Long vedio =0L;
|
|
|
Long vedio = 0L;
|
|
|
Long synegy = 0L;
|
|
|
Long topicZJ =0L;
|
|
|
Long vedioZJ =0L;
|
|
|
Long other =0L;
|
|
|
Long topicZJ = 0L;
|
|
|
Long vedioZJ = 0L;
|
|
|
Long other = 0L;
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
for(SaveModel saveModel:topicModels){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
for (SaveModel saveModel : topicModels) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
|
|
|
if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
|
|
|
if (doctorHospitalDOs != null && doctorHospitalDOs.size() != 0) {
|
|
|
saveModel.setDept(doctorHospitalDOs.get(0).getDeptCode());
|
|
|
saveModel.setDeptName(doctorHospitalDOs.get(0).getDeptName());
|
|
|
}
|
|
|
if(map.get("code").toString().equalsIgnoreCase(saveModel.getDept())) {
|
|
|
if (map.get("code").toString().equalsIgnoreCase(saveModel.getDept())) {
|
|
|
topic += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for(SaveModel saveModel:vedioModels){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
for (SaveModel saveModel : vedioModels) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
|
|
|
if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
|
|
|
if (doctorHospitalDOs != null && doctorHospitalDOs.size() != 0) {
|
|
|
saveModel.setDept(doctorHospitalDOs.get(0).getDeptCode());
|
|
|
saveModel.setDeptName(doctorHospitalDOs.get(0).getDeptName());
|
|
|
}
|
|
|
if(map.get("code").toString().equalsIgnoreCase(saveModel.getDept())){
|
|
|
vedio+=1;
|
|
|
if (map.get("code").toString().equalsIgnoreCase(saveModel.getDept())) {
|
|
|
vedio += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:synegyModels){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
for (SaveModel saveModel : synegyModels) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
|
|
|
if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
|
|
|
if (doctorHospitalDOs != null && doctorHospitalDOs.size() != 0) {
|
|
|
saveModel.setDept(doctorHospitalDOs.get(0).getDeptCode());
|
|
|
saveModel.setDeptName(doctorHospitalDOs.get(0).getDeptName());
|
|
|
}
|
|
|
if(map.get("code").toString().equalsIgnoreCase(saveModel.getDept())){
|
|
|
synegy+=1;
|
|
|
if (map.get("code").toString().equalsIgnoreCase(saveModel.getDept())) {
|
|
|
synegy += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:specialistModels){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
for (SaveModel saveModel : specialistModels) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
|
|
|
if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
|
|
|
if (doctorHospitalDOs != null && doctorHospitalDOs.size() != 0) {
|
|
|
saveModel.setDept(doctorHospitalDOs.get(0).getDeptCode());
|
|
|
saveModel.setDeptName(doctorHospitalDOs.get(0).getDeptName());
|
|
|
}
|
|
|
if(map.get("code").toString().equalsIgnoreCase(saveModel.getDept())){
|
|
|
topicZJ+=1;
|
|
|
if (map.get("code").toString().equalsIgnoreCase(saveModel.getDept())) {
|
|
|
topicZJ += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:specialistSPModels){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
for (SaveModel saveModel : specialistSPModels) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
|
|
|
if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
|
|
|
if (doctorHospitalDOs != null && doctorHospitalDOs.size() != 0) {
|
|
|
saveModel.setDept(doctorHospitalDOs.get(0).getDeptCode());
|
|
|
saveModel.setDeptName(doctorHospitalDOs.get(0).getDeptName());
|
|
|
}
|
|
|
if(map.get("code").toString().equalsIgnoreCase(saveModel.getDept())){
|
|
|
vedioZJ+=1;
|
|
|
if (map.get("code").toString().equalsIgnoreCase(saveModel.getDept())) {
|
|
|
vedioZJ += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
jsonObject.put("topic",topic);//图文
|
|
|
jsonObject.put("vedio",vedio);//视频
|
|
|
jsonObject.put("synegy",synegy);//协同
|
|
|
jsonObject.put("topicZJ",topicZJ);//专家
|
|
|
jsonObject.put("vedioZJ",vedioZJ);//视频
|
|
|
jsonObject.put("other",other);//其他
|
|
|
jsonObject.put("doctorName","-");//医生名字
|
|
|
jsonObject.put("doctorJob","-");//医生职称
|
|
|
jsonObject.put("deptCode",map.get("code"));
|
|
|
jsonObject.put("deptName",map.get("name"));
|
|
|
jsonObject.put("topic", topic);//图文
|
|
|
jsonObject.put("vedio", vedio);//视频
|
|
|
jsonObject.put("synegy", synegy);//协同
|
|
|
jsonObject.put("topicZJ", topicZJ);//专家
|
|
|
jsonObject.put("vedioZJ", vedioZJ);//视频
|
|
|
jsonObject.put("other", other);//其他
|
|
|
jsonObject.put("doctorName", "-");//医生名字
|
|
|
jsonObject.put("doctorJob", "-");//医生职称
|
|
|
jsonObject.put("deptCode", map.get("code"));
|
|
|
jsonObject.put("deptName", map.get("name"));
|
|
|
array.add(jsonObject);
|
|
|
}
|
|
|
}else if (level==5){
|
|
|
} else if (level == 5) {
|
|
|
Set<JSONObject> set = new HashSet<>();
|
|
|
for(SaveModel saveModel:topicModels){
|
|
|
for (SaveModel saveModel : topicModels) {
|
|
|
JSONObject object1 = new JSONObject();
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(saveModel.getDoctor());
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
|
|
|
if (doctorHospitalDOs!=null&&doctorHospitalDOs.size()!=0){
|
|
|
object1.put("deptCode",doctorHospitalDOs.get(0).getDeptCode());
|
|
|
object1.put("deptName",doctorHospitalDOs.get(0).getDeptName());
|
|
|
}else {
|
|
|
object1.put("deptCode",null);
|
|
|
object1.put("deptName",null);
|
|
|
if (doctorHospitalDOs != null && doctorHospitalDOs.size() != 0) {
|
|
|
object1.put("deptCode", doctorHospitalDOs.get(0).getDeptCode());
|
|
|
object1.put("deptName", doctorHospitalDOs.get(0).getDeptName());
|
|
|
} else {
|
|
|
object1.put("deptCode", null);
|
|
|
object1.put("deptName", null);
|
|
|
}
|
|
|
object1.put("doctor",doctorDO.getId());
|
|
|
object1.put("doctorName",doctorDO.getName());//
|
|
|
object1.put("doctorJob",doctorDO.getJobTitleName());//
|
|
|
object1.put("doctor",doctorDO.getId());
|
|
|
object1.put("doctor", doctorDO.getId());
|
|
|
object1.put("doctorName", doctorDO.getName());//
|
|
|
object1.put("doctorJob", doctorDO.getJobTitleName());//
|
|
|
object1.put("doctor", doctorDO.getId());
|
|
|
set.add(object1);
|
|
|
}
|
|
|
for (JSONObject jsonObject:set){
|
|
|
for (JSONObject jsonObject : set) {
|
|
|
Long topic = 0L;
|
|
|
Long vedio =0L;
|
|
|
Long vedio = 0L;
|
|
|
Long synegy = 0L;
|
|
|
Long topicZJ = 0L;
|
|
|
Long vedioZJ =0L;
|
|
|
Long other =0L;
|
|
|
for(SaveModel saveModel:topicModels){
|
|
|
if(jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
topic+=1;
|
|
|
Long vedioZJ = 0L;
|
|
|
Long other = 0L;
|
|
|
for (SaveModel saveModel : topicModels) {
|
|
|
if (jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
topic += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:vedioModels){
|
|
|
if(jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
vedio+=1;
|
|
|
for (SaveModel saveModel : vedioModels) {
|
|
|
if (jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
vedio += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:synegyModels){
|
|
|
if(jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())){
|
|
|
if (saveModel.getResult1()>0){
|
|
|
synegy+=1;
|
|
|
for (SaveModel saveModel : synegyModels) {
|
|
|
if (jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
synegy += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:specialistModels) {
|
|
|
for (SaveModel saveModel : specialistModels) {
|
|
|
if (jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (saveModel.getResult1()>0){
|
|
|
topicZJ+=1;
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
topicZJ += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(SaveModel saveModel:specialistSPModels) {
|
|
|
for (SaveModel saveModel : specialistSPModels) {
|
|
|
if (jsonObject.getString("doctor").equalsIgnoreCase(saveModel.getDoctor())) {
|
|
|
if (saveModel.getResult1()>0){
|
|
|
vedioZJ+=1;
|
|
|
if (saveModel.getResult1() > 0) {
|
|
|
vedioZJ += 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
jsonObject.put("topic",topic);//图文
|
|
|
jsonObject.put("vedio",vedio);//视频
|
|
|
jsonObject.put("topicZJ",topicZJ);//图文
|
|
|
jsonObject.put("vedioZJ",vedioZJ);//视频
|
|
|
jsonObject.put("synegy",synegy);//协同
|
|
|
jsonObject.put("other",other);//其他
|
|
|
jsonObject.put("topic", topic);//图文
|
|
|
jsonObject.put("vedio", vedio);//视频
|
|
|
jsonObject.put("topicZJ", topicZJ);//图文
|
|
|
jsonObject.put("vedioZJ", vedioZJ);//视频
|
|
|
jsonObject.put("synegy", synegy);//协同
|
|
|
jsonObject.put("other", other);//其他
|
|
|
array.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
object.put("data",array);
|
|
|
object.put("data", array);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
@ -1729,10 +1727,10 @@ public class StatisticsEsService {
|
|
|
} else if (second == 0 && first == 0) {
|
|
|
return 0.0;
|
|
|
}
|
|
|
Double size =first / second;
|
|
|
Double size = first / second;
|
|
|
DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
|
|
|
Double filesize = Double.parseDouble(df.format(size));
|
|
|
return filesize ;
|
|
|
return filesize;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -1747,20 +1745,20 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
public JSONArray dateTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
public JSONArray dateTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
//startDate = DateUtil.getNextDay(startDate,-1);
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode);
|
|
|
}
|
|
|
}else if(StringUtils.isNoneBlank(lowCode2)&&!StringUtils.isNoneBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day,lowCode2);
|
|
|
}else {
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && !StringUtils.isNoneBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day);
|
|
|
}
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
@ -1772,7 +1770,7 @@ public class StatisticsEsService {
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("range", one.get("date"));
|
|
|
json.put("amount", 0);
|
|
|
json.put("num",0.00);
|
|
|
json.put("num", 0.00);
|
|
|
result.add(json);
|
|
|
}
|
|
|
// }
|
|
@ -1787,10 +1785,10 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
double num = saveModel.getResult1();
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
for(JSONObject obj : result){
|
|
|
if((obj.get("range")+"").equals(range)){
|
|
|
for (JSONObject obj : result) {
|
|
|
if ((obj.get("range") + "").equals(range)) {
|
|
|
obj.put("amount", amount);
|
|
|
obj.put("num",decimalFormat.format(num));
|
|
|
obj.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -1837,7 +1835,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -1860,20 +1858,20 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
public JSONArray dateTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
public JSONArray dateTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
//startDate = DateUtil.getNextDay(startDate,-1);
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode);
|
|
|
}
|
|
|
}else if(StringUtils.isNoneBlank(lowCode2)&&!StringUtils.isNoneBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day,lowCode2);
|
|
|
}else {
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && !StringUtils.isNoneBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day);
|
|
|
}
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
@ -1885,7 +1883,7 @@ public class StatisticsEsService {
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("range", one.get("date"));
|
|
|
json.put("amount", 0);
|
|
|
json.put("num",0.00);
|
|
|
json.put("num", 0.00);
|
|
|
result.add(json);
|
|
|
}
|
|
|
// }
|
|
@ -1901,10 +1899,10 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
double num = saveModel.getResult1();
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
for(JSONObject obj : result){
|
|
|
if((obj.get("range")+"").equals(range)){
|
|
|
for (JSONObject obj : result) {
|
|
|
if ((obj.get("range") + "").equals(range)) {
|
|
|
obj.put("amount", amount);
|
|
|
obj.put("num",decimalFormat.format(num));
|
|
|
obj.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -1951,7 +1949,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -1962,7 +1960,6 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 按周统计 折线图
|
|
|
*
|
|
@ -2057,7 +2054,7 @@ public class StatisticsEsService {
|
|
|
JSONObject range = new JSONObject();
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
countResult.put(endStr, range);
|
|
|
|
|
|
|
|
@ -2107,8 +2104,8 @@ public class StatisticsEsService {
|
|
|
double num = saveModel.getResult1();
|
|
|
long previousAmount = Long.valueOf(json.get("amount").toString());
|
|
|
double previousNum = Double.parseDouble(json.get("num").toString());
|
|
|
json.put("amount", amount+previousAmount);
|
|
|
json.put("num",decimalFormat.format(num+previousNum));
|
|
|
json.put("amount", amount + previousAmount);
|
|
|
json.put("num", decimalFormat.format(num + previousNum));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2128,7 +2125,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -2232,7 +2229,7 @@ public class StatisticsEsService {
|
|
|
JSONObject range = new JSONObject();
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
countResult.put(endStr, range);
|
|
|
|
|
|
|
|
@ -2280,7 +2277,7 @@ public class StatisticsEsService {
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
double num = saveModel.getResult1();
|
|
|
json.put("amount", amount);
|
|
|
json.put("num",decimalFormat.format(num));
|
|
|
json.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2300,7 +2297,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -2310,7 +2307,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private JSONArray weekTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
private JSONArray weekTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
// 起始日期
|
|
@ -2392,7 +2389,7 @@ public class StatisticsEsService {
|
|
|
JSONObject range = new JSONObject();
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
countResult.put(endStr, range);
|
|
|
|
|
|
|
|
@ -2415,16 +2412,15 @@ public class StatisticsEsService {
|
|
|
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
|
|
|
}
|
|
|
|
|
|
}else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week,lowCode2);
|
|
|
}
|
|
|
else {
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && StringUtils.isBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
|
|
|
}
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
@ -2449,7 +2445,7 @@ public class StatisticsEsService {
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
double num = saveModel.getResult1();
|
|
|
json.put("amount", amount);
|
|
|
json.put("num",decimalFormat.format(num));
|
|
|
json.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2469,7 +2465,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -2482,6 +2478,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 两位小数
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -2493,7 +2490,7 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
private JSONArray weekTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
private JSONArray weekTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
// 起始日期
|
|
@ -2575,7 +2572,7 @@ public class StatisticsEsService {
|
|
|
JSONObject range = new JSONObject();
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
countResult.put(endStr, range);
|
|
|
|
|
|
|
|
@ -2598,16 +2595,15 @@ public class StatisticsEsService {
|
|
|
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
|
|
|
}
|
|
|
|
|
|
}else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week,lowCode2);
|
|
|
}
|
|
|
else {
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && StringUtils.isBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
|
|
|
}
|
|
|
|
|
@ -2632,7 +2628,7 @@ public class StatisticsEsService {
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
double num = saveModel.getResult1();
|
|
|
json.put("amount", amount);
|
|
|
json.put("num",decimalFormat.format(num));
|
|
|
json.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2652,7 +2648,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -2675,7 +2671,7 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
private JSONArray monthTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
private JSONArray monthTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
@ -2699,7 +2695,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
if (startDate.compareTo(endDate) == 0) {
|
|
|
flag = false;
|
|
|
/* days.add(end);*/
|
|
|
/* days.add(end);*/
|
|
|
}
|
|
|
|
|
|
// 统计日期计算
|
|
@ -2717,7 +2713,7 @@ public class StatisticsEsService {
|
|
|
if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
|
|
|
days.add(next);
|
|
|
} else {
|
|
|
/* days.add(end);*/
|
|
|
/* days.add(end);*/
|
|
|
flag = false;
|
|
|
}
|
|
|
k++;
|
|
@ -2733,7 +2729,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
|
|
|
countResult.put(endStr, range);
|
|
|
}
|
|
@ -2746,13 +2742,13 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode);
|
|
|
}
|
|
|
} else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month,lowCode2);
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && StringUtils.isBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode2);
|
|
|
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month);
|
|
@ -2775,7 +2771,7 @@ public class StatisticsEsService {
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
double num = saveModel.getResult1();
|
|
|
json.put("amount", amount);
|
|
|
json.put("num",decimalFormat.format(num));
|
|
|
json.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2795,7 +2791,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -2818,7 +2814,7 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
private JSONArray monthTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
private JSONArray monthTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
@ -2842,7 +2838,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
if (startDate.compareTo(endDate) == 0) {
|
|
|
flag = false;
|
|
|
/* days.add(end);*/
|
|
|
/* days.add(end);*/
|
|
|
}
|
|
|
|
|
|
// 统计日期计算
|
|
@ -2860,7 +2856,7 @@ public class StatisticsEsService {
|
|
|
if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
|
|
|
days.add(next);
|
|
|
} else {
|
|
|
/* days.add(end);*/
|
|
|
/* days.add(end);*/
|
|
|
flag = false;
|
|
|
}
|
|
|
k++;
|
|
@ -2876,7 +2872,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
|
|
|
countResult.put(endStr, range);
|
|
|
}
|
|
@ -2889,13 +2885,13 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode);
|
|
|
}
|
|
|
} else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month,lowCode2);
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && StringUtils.isBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode2);
|
|
|
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month);
|
|
@ -2919,7 +2915,7 @@ public class StatisticsEsService {
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
double num = saveModel.getResult1();
|
|
|
json.put("amount", amount);
|
|
|
json.put("num",decimalFormat.format(num));
|
|
|
json.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -2939,7 +2935,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -2986,7 +2982,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
if (startDate.compareTo(endDate) == 0) {
|
|
|
flag = false;
|
|
|
/* days.add(end);*/
|
|
|
/* days.add(end);*/
|
|
|
}
|
|
|
|
|
|
// 统计日期计算
|
|
@ -3004,7 +3000,7 @@ public class StatisticsEsService {
|
|
|
if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
|
|
|
days.add(next);
|
|
|
} else {
|
|
|
/* days.add(end);*/
|
|
|
/* days.add(end);*/
|
|
|
flag = false;
|
|
|
}
|
|
|
k++;
|
|
@ -3020,7 +3016,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
|
|
|
countResult.put(endStr, range);
|
|
|
}
|
|
@ -3035,7 +3031,7 @@ public class StatisticsEsService {
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findDateQuotaLevel0AndPaibanLine(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findDateQuotaLevel0AndPaibanLine(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month,null);
|
|
|
saveModels = elasticsearchUtil.findDateQuotaLevel0AndPaibanLine(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, null);
|
|
|
}
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
if (saveModels != null) {
|
|
@ -3054,7 +3050,7 @@ public class StatisticsEsService {
|
|
|
long amount = saveModel.getResult2().longValue();
|
|
|
double num = saveModel.getResult1();
|
|
|
json.put("amount", amount);
|
|
|
json.put("num",decimalFormat.format(num));
|
|
|
json.put("num", decimalFormat.format(num));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -3074,7 +3070,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -3087,9 +3083,10 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 专科咨询统计总量
|
|
|
*
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param area 区域
|
|
|
* @param endDate 结束时间
|
|
|
* @param area 区域
|
|
|
* @param level
|
|
|
* @param index
|
|
|
* @return
|
|
@ -3109,25 +3106,26 @@ public class StatisticsEsService {
|
|
|
//进行中
|
|
|
SaveModel saveModel5 = null;
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "7", SaveModel.timeLevel_DDL);
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "6", SaveModel.timeLevel_DDL,"1");
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "6", SaveModel.timeLevel_DDL,"0");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "7", SaveModel.timeLevel_DDL,"-1");
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "7", SaveModel.timeLevel_DDL,"0");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "7", SaveModel.timeLevel_DDL,"1");
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "6", SaveModel.timeLevel_DDL, "1");
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "6", SaveModel.timeLevel_DDL, "0");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "7", SaveModel.timeLevel_DDL, "-1");
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "7", SaveModel.timeLevel_DDL, "0");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, "7", SaveModel.timeLevel_DDL, "1");
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("specialConsultTotal",saveModel.getResult1());
|
|
|
object.put("haveReplyTotal",saveModel1.getResult1());
|
|
|
object.put("endTotal",saveModel2.getResult1());
|
|
|
object.put("notReplyTotal",saveModel3.getResult1());
|
|
|
object.put("cancelTotal",saveModel4.getResult1());
|
|
|
object.put("comingTotal",saveModel5.getResult1());
|
|
|
object.put("notReplyRate",getRange(saveModel3.getResult1().intValue(),saveModel.getResult1().intValue(),2));//未回复率
|
|
|
object.put("specialConsultTotal", saveModel.getResult1());
|
|
|
object.put("haveReplyTotal", saveModel1.getResult1());
|
|
|
object.put("endTotal", saveModel2.getResult1());
|
|
|
object.put("notReplyTotal", saveModel3.getResult1());
|
|
|
object.put("cancelTotal", saveModel4.getResult1());
|
|
|
object.put("comingTotal", saveModel5.getResult1());
|
|
|
object.put("notReplyRate", getRange(saveModel3.getResult1().intValue(), saveModel.getResult1().intValue(), 2));//未回复率
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 专科咨询统计曲线
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -3138,18 +3136,18 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getSpecialConsultLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
public JSONObject getSpecialConsultLine(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
if (interval == 1) {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
@ -3157,6 +3155,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 专科咨询统计表格
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param level
|
|
@ -3165,15 +3164,15 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultingStatisticsList(String startTime,String endTime,int level, String area, String lowLevel) throws Exception {
|
|
|
public JSONObject getConsultingStatisticsList(String startTime, String endTime, int level, String area, String lowLevel) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
// timeKey= "2017-11-01 00:00:00";
|
|
|
//已结束
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(endTime, endTime, area, level, "7", SaveModel.timeLevel_DDL, lowLevel,"1");
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(endTime, endTime, area, level, "7", SaveModel.timeLevel_DDL, lowLevel, "1");
|
|
|
//咨询总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(endTime, endTime, area, level, "6", SaveModel.timeLevel_DDL, lowLevel);
|
|
|
//未回复数
|
|
|
List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(endTime, endTime, area, level, "6", SaveModel.timeLevel_DDL, lowLevel,"0");
|
|
|
List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(endTime, endTime, area, level, "6", SaveModel.timeLevel_DDL, lowLevel, "0");
|
|
|
// JSONArray rely = new JSONArray(relyVal);
|
|
|
// JSONArray total = new JSONArray(relyTotal);
|
|
|
// JSONArray noRely = new JSONArray(noRelyTotal);
|
|
@ -3182,7 +3181,6 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getCoutList1(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> noReceive) {
|
|
|
Map<String, Object> relyMap = new HashMap<>();
|
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
@ -3195,7 +3193,7 @@ public class StatisticsEsService {
|
|
|
relyMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
relyMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
relyMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3207,7 +3205,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3218,7 +3216,7 @@ public class StatisticsEsService {
|
|
|
noReceiveMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
noReceiveMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
noReceiveMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3298,7 +3296,7 @@ public class StatisticsEsService {
|
|
|
relyMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
relyMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
relyMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3310,7 +3308,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3321,7 +3319,7 @@ public class StatisticsEsService {
|
|
|
noRelyMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
noRelyMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
noRelyMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3392,6 +3390,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 服务评分平均分
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -3408,15 +3407,16 @@ public class StatisticsEsService {
|
|
|
JSONObject object = new JSONObject();
|
|
|
Double scoreTotal = saveModel.getResult1();//总评分
|
|
|
Double people = saveModel.getResult2();//评价总人数
|
|
|
object.put("scoreTotal",scoreTotal);//总评分
|
|
|
object.put("people",people);//总人数
|
|
|
object.put("scoreRate",getDoubleRange(scoreTotal,people,0));//平均评分
|
|
|
object.put("scoreTotal", scoreTotal);//总评分
|
|
|
object.put("people", people);//总人数
|
|
|
object.put("scoreRate", getDoubleRange(scoreTotal, people, 0));//平均评分
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 服务评分曲线
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -3427,29 +3427,29 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getScoreLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
public JSONObject getScoreLine(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
//服务评分
|
|
|
JSONObject object = new JSONObject();
|
|
|
JSONArray array = new JSONArray();
|
|
|
if (interval==1){
|
|
|
array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
}else if (interval==2){
|
|
|
array = weekTotalStatistics7(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
}else if (interval==3){
|
|
|
array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
}
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
if (interval == 1) {
|
|
|
array = dateTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
} else if (interval == 2) {
|
|
|
array = weekTotalStatistics7(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
} else if (interval == 3) {
|
|
|
array = monthTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
}
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject jsonObject = array.getJSONObject(i);
|
|
|
Long amount = jsonObject.getLong("amount");
|
|
|
Double num = jsonObject.getDouble("num");
|
|
|
jsonObject.put("scoreRate",getDoubleRange(num,amount.doubleValue(),0));
|
|
|
jsonObject.put("scoreRate", getDoubleRange(num, amount.doubleValue(), 0));
|
|
|
}
|
|
|
object.put("data",array);
|
|
|
object.put("data", array);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getScoreList(String startTime,String endTime,int level, String area, String lowLevel) throws Exception {
|
|
|
public JSONObject getScoreList(String startTime, String endTime, int level, String area, String lowLevel) throws Exception {
|
|
|
JSONObject result1 = new JSONObject();
|
|
|
|
|
|
//评价总分
|
|
@ -3465,7 +3465,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3488,7 +3488,7 @@ public class StatisticsEsService {
|
|
|
rs.put("name", totalRs.getHospitalName());
|
|
|
}
|
|
|
rs.put("total", totalNm);
|
|
|
rs.put("scoreRate",getDoubleRange(scoreNm,totalNm,0));
|
|
|
rs.put("scoreRate", getDoubleRange(scoreNm, totalNm, 0));
|
|
|
rs.put("code", key);
|
|
|
resultMaps.add(rs);
|
|
|
}
|
|
@ -3506,6 +3506,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 医生排班
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param index
|
|
@ -3514,101 +3515,102 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getScheduleTotal(String startTime,String endTime,String index,Integer level, String area) throws Exception {
|
|
|
public JSONObject getScheduleTotal(String startTime, String endTime, String index, Integer level, String area) throws Exception {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
String condition = "";
|
|
|
if (SaveModel.cityLevel.equalsIgnoreCase(level.toString())){
|
|
|
condition +="";
|
|
|
}else if (SaveModel.OrgLevel.equalsIgnoreCase(level.toString())){
|
|
|
condition +=" and dh.org_code ='"+area+"' ";
|
|
|
}else if (SaveModel.townLevel.equalsIgnoreCase(level.toString())){
|
|
|
condition +=" ";
|
|
|
}else if (SaveModel.deptLevel.equalsIgnoreCase(level.toString())){
|
|
|
condition +=" and dh.dept_code = '"+area+"'";
|
|
|
}else if (SaveModel.doctorLevel.equalsIgnoreCase(level.toString())){
|
|
|
condition +=" and dh.doctor_code = '"+area+"'";
|
|
|
}
|
|
|
String sql = "SELECT COUNT(*) as \"total\" FROM `base_doctor_role` dr LEFT JOIN base_doctor_hospital dh ON dr.doctor_code = dh.doctor_code where dr.role_code='specialist' "+condition;
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
if (SaveModel.cityLevel.equalsIgnoreCase(level.toString())) {
|
|
|
condition += "";
|
|
|
} else if (SaveModel.OrgLevel.equalsIgnoreCase(level.toString())) {
|
|
|
condition += " and dh.org_code ='" + area + "' ";
|
|
|
} else if (SaveModel.townLevel.equalsIgnoreCase(level.toString())) {
|
|
|
condition += " ";
|
|
|
} else if (SaveModel.deptLevel.equalsIgnoreCase(level.toString())) {
|
|
|
condition += " and dh.dept_code = '" + area + "'";
|
|
|
} else if (SaveModel.doctorLevel.equalsIgnoreCase(level.toString())) {
|
|
|
condition += " and dh.doctor_code = '" + area + "'";
|
|
|
}
|
|
|
String sql = "SELECT COUNT(*) as \"total\" FROM `base_doctor_role` dr LEFT JOIN base_doctor_hospital dh ON dr.doctor_code = dh.doctor_code where dr.role_code='specialist' " + condition;
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
Long doctorCount = 0L;
|
|
|
if (mapList!=null&&mapList.size()!=0){
|
|
|
if (mapList != null && mapList.size() != 0) {
|
|
|
doctorCount = Long.parseLong(mapList.get(0).get("total").toString());
|
|
|
}
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, SaveModel.interval_day);
|
|
|
Set<String> set = new HashSet<>();
|
|
|
Long days = 0L;
|
|
|
for (SaveModel saveModel1:saveModels){
|
|
|
if(saveModel1.getResult1()!=0){
|
|
|
days+=1;
|
|
|
for (SaveModel saveModel1 : saveModels) {
|
|
|
if (saveModel1.getResult1() != 0) {
|
|
|
days += 1;
|
|
|
}
|
|
|
}
|
|
|
List<SaveModel> saveModels1 = elasticsearchUtil.findDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, SaveModel.interval_day,SaveModel.doctorLevel);
|
|
|
for (SaveModel saveModel1:saveModels1){
|
|
|
if(saveModel1.getResult1()!=0){
|
|
|
List<SaveModel> saveModels1 = elasticsearchUtil.findDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, SaveModel.interval_day, SaveModel.doctorLevel);
|
|
|
for (SaveModel saveModel1 : saveModels1) {
|
|
|
if (saveModel1.getResult1() != 0) {
|
|
|
set.add(saveModel1.getDoctor());
|
|
|
}
|
|
|
}
|
|
|
Integer total = set.size();
|
|
|
jsonObject.put("rate",getTwoRange(total,doctorCount.intValue(),0));//排班比例
|
|
|
jsonObject.put("doctorCount",doctorCount);
|
|
|
jsonObject.put("days",days);
|
|
|
jsonObject.put("total",total);
|
|
|
jsonObject.put("rate", getTwoRange(total, doctorCount.intValue(), 0));//排班比例
|
|
|
jsonObject.put("doctorCount", doctorCount);
|
|
|
jsonObject.put("days", days);
|
|
|
jsonObject.put("total", total);
|
|
|
|
|
|
return jsonObject;
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 通用查询曲线
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level
|
|
|
* @param index
|
|
|
* @param interval 1按日统计,2按周统计,3按月统计
|
|
|
* @param interval 1按日统计,2按周统计,3按月统计
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getScheduleLine(String startDate, String endDate, String area, int level, String index,int interval) throws Exception {
|
|
|
public JSONObject getScheduleLine(String startDate, String endDate, String area, int level, String index, int interval) throws Exception {
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics7(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2AndMonth(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
if (interval == 1) {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics7(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2AndMonth(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getScheduleList(String startTime,String endTime,String index,int level, String area, String lowLevel) throws Exception {
|
|
|
public JSONObject getScheduleList(String startTime, String endTime, String index, int level, String area, String lowLevel) throws Exception {
|
|
|
JSONObject result1 = new JSONObject();
|
|
|
List<SaveModel> total = elasticsearchUtil.findDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL,null, lowLevel);
|
|
|
List<SaveModel> total1 = elasticsearchUtil.findDateQuotaLevel0AndPaibanList(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL,null, lowLevel);
|
|
|
List<SaveModel> total = elasticsearchUtil.findDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, null, lowLevel);
|
|
|
List<SaveModel> total1 = elasticsearchUtil.findDateQuotaLevel0AndPaibanList(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, null, lowLevel);
|
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
|
String low_level = StringUtils.isEmpty(lowLevel) ? String.valueOf(level + 1) : lowLevel;
|
|
|
List<String> codes = new ArrayList<>();
|
|
|
for (SaveModel saveModel:total){
|
|
|
for (SaveModel saveModel1:total1){
|
|
|
for (SaveModel saveModel : total) {
|
|
|
for (SaveModel saveModel1 : total1) {
|
|
|
if (SaveModel.doctorLevel.equals(low_level)) {
|
|
|
if (saveModel.getDoctor().equalsIgnoreCase(saveModel1.getDoctor())){
|
|
|
if (saveModel.getDoctor().equalsIgnoreCase(saveModel1.getDoctor())) {
|
|
|
saveModel.setResult1(saveModel1.getResult1());
|
|
|
saveModel.setResult2(saveModel1.getResult2());
|
|
|
codes.add(saveModel1.getDoctor());
|
|
|
}
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
if (saveModel.getDept().equalsIgnoreCase(saveModel1.getDept())){
|
|
|
if (saveModel.getDept().equalsIgnoreCase(saveModel1.getDept())) {
|
|
|
saveModel.setResult1(saveModel1.getResult1());
|
|
|
saveModel.setResult2(saveModel1.getResult2());
|
|
|
codes.add(saveModel1.getDept());
|
|
|
}
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
if (saveModel.getHospital().equalsIgnoreCase(saveModel1.getHospital())){
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
if (saveModel.getHospital().equalsIgnoreCase(saveModel1.getHospital())) {
|
|
|
saveModel.setResult1(saveModel1.getResult1());
|
|
|
saveModel.setResult2(saveModel1.getResult2());
|
|
|
codes.add(saveModel1.getHospital());
|
|
@ -3616,21 +3618,21 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel:total){
|
|
|
for (SaveModel saveModel : total) {
|
|
|
if (SaveModel.doctorLevel.equals(low_level)) {
|
|
|
if (!codes.contains(saveModel.getDoctor())){
|
|
|
if (!codes.contains(saveModel.getDoctor())) {
|
|
|
saveModel.setResult1(0.0);
|
|
|
saveModel.setResult2(0.0);
|
|
|
|
|
|
}
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
if (!codes.contains(saveModel.getDept())){
|
|
|
if (!codes.contains(saveModel.getDept())) {
|
|
|
saveModel.setResult1(0.0);
|
|
|
saveModel.setResult2(0.0);
|
|
|
|
|
|
}
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
if (!codes.contains(saveModel.getHospital())){
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
if (!codes.contains(saveModel.getHospital())) {
|
|
|
saveModel.setResult1(0.0);
|
|
|
saveModel.setResult2(0.0);
|
|
|
|
|
@ -3642,7 +3644,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -3660,14 +3662,14 @@ public class StatisticsEsService {
|
|
|
if (SaveModel.doctorLevel.equals(low_level)) {
|
|
|
rs.put("name", totalRs.getDoctorName());
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(totalRs.getDoctor());
|
|
|
rs.put("doctorJob",doctorDO.getJobTitleName());
|
|
|
rs.put("doctorJob", doctorDO.getJobTitleName());
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
rs.put("name", totalRs.getDeptName());
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
rs.put("name", totalRs.getHospitalName());
|
|
|
}
|
|
|
rs.put("total", totalNm);
|
|
|
rs.put("scoreRate",getDoubleRange(scoreNm,totalNm,0));
|
|
|
rs.put("scoreRate", getDoubleRange(scoreNm, totalNm, 0));
|
|
|
rs.put("code", key);
|
|
|
resultMaps.add(rs);
|
|
|
}
|
|
@ -3678,9 +3680,9 @@ public class StatisticsEsService {
|
|
|
return (Double) o1.get("total") < (Double) o2.get("total") ? 1 : ((Double) o1.get("total") == (Double) o2.get("total") ? 0 : -1);
|
|
|
}
|
|
|
});*/
|
|
|
Collections.sort(resultMaps, new Comparator<Map<String,Object>>() {
|
|
|
Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
|
|
|
@Override
|
|
|
public int compare(Map<String,Object> o1, Map<String,Object> o2) {
|
|
|
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
|
|
|
Double total1 = (Double) o1.get("total");
|
|
|
Double total2 = (Double) o2.get("total");
|
|
|
if (total1 - total2 > 0) {
|
|
@ -3696,21 +3698,20 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 咨询统计总量
|
|
|
*
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param area 区域
|
|
|
* @param endDate 结束时间
|
|
|
* @param area 区域
|
|
|
* @param level
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultHead(String startDate, String endDate, String area, int level, String index,String lowCode) throws Exception {
|
|
|
public JSONObject getConsultHead(String startDate, String endDate, String area, int level, String index, String lowCode) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (index.equalsIgnoreCase("6")){
|
|
|
if (index.equalsIgnoreCase("6")) {
|
|
|
//总量
|
|
|
SaveModel saveModel = null;
|
|
|
//已回复
|
|
@ -3723,21 +3724,21 @@ public class StatisticsEsService {
|
|
|
SaveModel saveModel4 = null;
|
|
|
//进行中
|
|
|
SaveModel saveModel5 = null;
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL);
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"1");
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"0");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"-1");
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("consultTotal",saveModel.getResult1());
|
|
|
object.put("haveReplyTotal",saveModel1.getResult1());
|
|
|
object.put("endTotal",saveModel2.getResult1());
|
|
|
object.put("notReplyTotal",saveModel3.getResult1());
|
|
|
object.put("cancelTotal",saveModel4.getResult1());
|
|
|
object.put("comingTotal",saveModel5.getResult1());
|
|
|
object.put("notReplyRate",getRange(saveModel3.getResult1().intValue(),saveModel.getResult1().intValue(),2));//未回复率
|
|
|
}else {
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "0");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, "-1");
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, "0");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("consultTotal", saveModel.getResult1());
|
|
|
object.put("haveReplyTotal", saveModel1.getResult1());
|
|
|
object.put("endTotal", saveModel2.getResult1());
|
|
|
object.put("notReplyTotal", saveModel3.getResult1());
|
|
|
object.put("cancelTotal", saveModel4.getResult1());
|
|
|
object.put("comingTotal", saveModel5.getResult1());
|
|
|
object.put("notReplyRate", getRange(saveModel3.getResult1().intValue(), saveModel.getResult1().intValue(), 2));//未回复率
|
|
|
} else {
|
|
|
//总量
|
|
|
SaveModel saveModel = null;
|
|
|
//已接诊
|
|
@ -3750,17 +3751,17 @@ public class StatisticsEsService {
|
|
|
SaveModel saveModel4 = null;
|
|
|
/* //进行中
|
|
|
SaveModel saveModel5 = null;*/
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
//居民取消
|
|
|
List<SaveModel> concleTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null,lowCode,"-1");
|
|
|
List<SaveModel> concleTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, lowCode, "-1");
|
|
|
//咨询总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, null,lowCode);
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, null, lowCode);
|
|
|
//已结束
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null,lowCode,"3");
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, lowCode, "3");
|
|
|
//已接诊
|
|
|
List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, null,lowCode,"1");
|
|
|
List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, null, lowCode, "1");
|
|
|
//未接诊
|
|
|
List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null,lowCode,"0");
|
|
|
List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, lowCode, "0");
|
|
|
saveModel = total.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL,lowCode,"");
|
|
|
saveModel1 = haveReceiveTotal.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,lowCode,"1");
|
|
|
saveModel3 = endTotal.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,lowCode,"3");
|
|
@ -3768,14 +3769,15 @@ public class StatisticsEsService {
|
|
|
/*
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
|
|
|
*/
|
|
|
saveModel2 = noReceiveTotal.get(0);elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,lowCode,"0");
|
|
|
object.put("consultTotal",saveModel.getResult1());//咨询总量
|
|
|
object.put("haveReceiveTotal",saveModel1.getResult1());//已接诊
|
|
|
object.put("noReceiveTotal",saveModel2.getResult1());//未接诊
|
|
|
object.put("endTotal",saveModel3.getResult1());//已结束
|
|
|
object.put("cancelTotal",saveModel4.getResult1());//居民取消
|
|
|
/* object.put("comingTotal",saveModel5.getResult1());*/
|
|
|
object.put("notReceiveRate",getRange(saveModel2.getResult1().intValue(),saveModel.getResult1().intValue(),2));//未接诊比例
|
|
|
saveModel2 = noReceiveTotal.get(0);
|
|
|
elasticsearchUtil.bfindOneDateQuotaLevel12(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, lowCode, "0");
|
|
|
object.put("consultTotal", saveModel.getResult1());//咨询总量
|
|
|
object.put("haveReceiveTotal", saveModel1.getResult1());//已接诊
|
|
|
object.put("noReceiveTotal", saveModel2.getResult1());//未接诊
|
|
|
object.put("endTotal", saveModel3.getResult1());//已结束
|
|
|
object.put("cancelTotal", saveModel4.getResult1());//居民取消
|
|
|
/* object.put("comingTotal",saveModel5.getResult1());*/
|
|
|
object.put("notReceiveRate", getRange(saveModel2.getResult1().intValue(), saveModel.getResult1().intValue(), 2));//未接诊比例
|
|
|
}
|
|
|
|
|
|
return object;
|
|
@ -3784,29 +3786,30 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 咨询统计曲线
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param interval
|
|
|
* @param level2_type
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
public JSONObject getConsultLine(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics7(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
if (interval == 1) {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index1, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics7(startDate, endDate, area, level, index1, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, index1, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
@ -3814,34 +3817,35 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 咨询统计表格
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param level
|
|
|
* @param area
|
|
|
* @param lowLevel
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultingList(String startTime,String endTime,int level, String area, String lowLevel,String index) throws Exception {
|
|
|
public JSONObject getConsultingList(String startTime, String endTime, int level, String area, String lowLevel, String index) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if(index.equalsIgnoreCase("6")){
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
if (index.equalsIgnoreCase("6")) {
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
//已结束
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"1");
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, "1");
|
|
|
//咨询总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
|
|
|
//未回复数
|
|
|
List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
|
|
|
List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel, "0");
|
|
|
result.put("resultList", getCoutList(level, lowLevel, endTotal, total, noRelyTotal));
|
|
|
}else {
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
} else {
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
//未接诊
|
|
|
List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"0");
|
|
|
List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, "0");
|
|
|
//咨询总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
|
|
|
//已结束
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1,2,3");
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel, "1,2,3");
|
|
|
result.put("resultList", getCoutList1(level, lowLevel, endTotal, total, noReceiveTotal));
|
|
|
}
|
|
|
|
|
@ -3851,10 +3855,11 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* app端首页门诊量统计
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param level 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param index
|
|
|
* @return
|
|
|
* @throws Exception
|
|
@ -3862,13 +3867,13 @@ public class StatisticsEsService {
|
|
|
public JSONObject getConsultTotalApp(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
String str[] = new String[]{};
|
|
|
if (StringUtils.isNoneBlank(index)){
|
|
|
str =index.split(",");
|
|
|
if (StringUtils.isNoneBlank(index)) {
|
|
|
str = index.split(",");
|
|
|
}
|
|
|
for (int i=0;i<str.length;i++){
|
|
|
String index1 = (Integer.parseInt(str[i])+1)+"";
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level,index1 , SaveModel.timeLevel_ZL);
|
|
|
object.put("index_"+str[i],saveModel.getResult1());
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
String index1 = (Integer.parseInt(str[i]) + 1) + "";
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL);
|
|
|
object.put("index_" + str[i], saveModel.getResult1());
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
@ -3876,6 +3881,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* app端门诊量统计维度-圆形比例
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -3888,45 +3894,46 @@ public class StatisticsEsService {
|
|
|
JSONObject object = new JSONObject();
|
|
|
//协同门诊
|
|
|
SaveModel saveModel1 = null;
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL,"12");
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL, "12");
|
|
|
//图文复诊
|
|
|
SaveModel saveModel2 = null;
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL,"9");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "9");
|
|
|
//视频复诊
|
|
|
SaveModel saveModel3 = null;
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL,"16");
|
|
|
Double specialistCount =0.0;
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "16");
|
|
|
Double specialistCount = 0.0;
|
|
|
//专科咨询
|
|
|
SaveModel saveModel4 = null;
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL,"1");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "1");
|
|
|
specialistCount = saveModel4.getResult1();//专家咨询数量
|
|
|
Double specialistSPCount =0.0;
|
|
|
Double specialistSPCount = 0.0;
|
|
|
//专科咨询
|
|
|
SaveModel saveModel5 = null;
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL,"17");
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "17");
|
|
|
specialistSPCount = saveModel5.getResult1();//专家咨询数量
|
|
|
|
|
|
Double synergyCount = saveModel1.getResult1();//协同门诊数量
|
|
|
Double topicCount = saveModel2.getResult1();//图文复诊数量
|
|
|
Double videoCount = saveModel3.getResult1();//视频复诊数量
|
|
|
Double total = specialistCount+synergyCount+topicCount+videoCount+specialistSPCount;//总量
|
|
|
object.put("specialistCount",specialistCount);//专家咨询数
|
|
|
object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
|
|
|
object.put("specialistSPCount",specialistSPCount);//专家咨询sp数
|
|
|
object.put("specialistSPRate",getRange(specialistSPCount.intValue(),total.intValue(),0));
|
|
|
object.put("synergyCount",synergyCount);//专家咨询数
|
|
|
object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
|
|
|
object.put("topicCount",topicCount);//图文复诊数量
|
|
|
object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
|
|
|
object.put("videoCount",videoCount);//视频复诊数量
|
|
|
object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
|
|
|
object.put("total",total);
|
|
|
Double total = specialistCount + synergyCount + topicCount + videoCount + specialistSPCount;//总量
|
|
|
object.put("specialistCount", specialistCount);//专家咨询数
|
|
|
object.put("specialistRate", getRange(specialistCount.intValue(), total.intValue(), 0));
|
|
|
object.put("specialistSPCount", specialistSPCount);//专家咨询sp数
|
|
|
object.put("specialistSPRate", getRange(specialistSPCount.intValue(), total.intValue(), 0));
|
|
|
object.put("synergyCount", synergyCount);//专家咨询数
|
|
|
object.put("synergyRate", getRange(synergyCount.intValue(), total.intValue(), 0));
|
|
|
object.put("topicCount", topicCount);//图文复诊数量
|
|
|
object.put("topicRate", getRange(topicCount.intValue(), total.intValue(), 0));
|
|
|
object.put("videoCount", videoCount);//视频复诊数量
|
|
|
object.put("videoRate", getRange(videoCount.intValue(), total.intValue(), 0));
|
|
|
object.put("total", total);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* app端门诊量统计-按照日周月
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -3937,18 +3944,18 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultLineApp(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
public JSONObject getConsultLineApp(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics7(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
|
|
|
object.put("data",array);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
if (interval == 1) {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics7(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL);
|
|
|
object.put("data", array);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, index, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
}
|
|
|
return object;
|
|
|
}
|
|
@ -3956,6 +3963,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 门诊量统计-app端
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param level
|
|
@ -3965,7 +3973,7 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultListApp(String startTime,String endTime,int level, String area, String lowLevel,String index) throws Exception {
|
|
|
public JSONObject getConsultListApp(String startTime, String endTime, int level, String area, String lowLevel, String index) throws Exception {
|
|
|
JSONObject result1 = new JSONObject();
|
|
|
|
|
|
//门诊量总数
|
|
@ -3981,7 +3989,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4004,7 +4012,7 @@ public class StatisticsEsService {
|
|
|
rs.put("name", totalRs.getHospitalName());
|
|
|
}
|
|
|
rs.put("total", totalNm);
|
|
|
rs.put("consultRate",getDoubleRange(consultNm,totalNm,0));
|
|
|
rs.put("consultRate", getDoubleRange(consultNm, totalNm, 0));
|
|
|
rs.put("code", key);
|
|
|
resultMaps.add(rs);
|
|
|
}
|
|
@ -4020,96 +4028,98 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 咨询统计曲线-PC
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param interval
|
|
|
* @param level2_type
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultLinePC(String startDate, String endDate, String area, int level, String index,int interval, String level2_type,String lowCode) throws Exception {
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
public JSONObject getConsultLinePC(String startDate, String endDate, String area, int level, String index, int interval, String level2_type, String lowCode) throws Exception {
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
if (index.equalsIgnoreCase("6")){
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("totalData",array);//新增量
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index,"0",SaveModel.timeLevel_ZL,null);//未回复
|
|
|
object.put("noReplyData",array1);//未回复
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,null);//已回复
|
|
|
object.put("replyData",array2);//已回复
|
|
|
JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);//进行中
|
|
|
object.put("commingData",array3);//进行中
|
|
|
JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL,null);//已完成
|
|
|
object.put("endData",array4);//已完成
|
|
|
}else {
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("totalData",array);//新增量
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
|
|
|
object.put("noReceiveData",array1);//未接诊
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");//已接诊
|
|
|
object.put("haveReceiveData",array2);//已接诊
|
|
|
JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"-1");//患者取消
|
|
|
object.put("concleData",array3);//患者取消
|
|
|
JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"3");//已结束
|
|
|
object.put("endData",array4);//已结束
|
|
|
}
|
|
|
|
|
|
}else if (interval==2){
|
|
|
if (index.equalsIgnoreCase("6")){
|
|
|
JSONArray array = weekTotalStatistics8(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("totalData",array);//新增量
|
|
|
JSONArray array1 = weekTotalStatistics7(startDate,endDate,area,level,index,"0",SaveModel.timeLevel_ZL);//未回复
|
|
|
object.put("noReplyData",array1);;//未回复
|
|
|
JSONArray array2 = weekTotalStatistics7(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL);//已回复
|
|
|
object.put("replyData",array2);//已回复
|
|
|
JSONArray array3 = weekTotalStatistics7(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL);//进行中
|
|
|
object.put("commingData",array3);//进行中
|
|
|
JSONArray array4 = weekTotalStatistics7(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL);//已完成
|
|
|
object.put("endData",array3);//进行中
|
|
|
}else {
|
|
|
JSONArray array = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("totalData",array);//新增量
|
|
|
JSONArray array1 = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
|
|
|
object.put("noReceiveData",array1);;//未接诊
|
|
|
JSONArray array2 = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");//已接诊
|
|
|
object.put("haveReceiveData",array2);//已接诊
|
|
|
JSONArray array3 = weekTotalStatistics8(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"-1");//患者取消
|
|
|
object.put("concleData",array3);//患者取消
|
|
|
JSONArray array4 = weekTotalStatistics8(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"3");//已结束
|
|
|
object.put("endData",array4);//已结束
|
|
|
}
|
|
|
|
|
|
}else if (interval==3){
|
|
|
if (index.equalsIgnoreCase("6")){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("totalData",array);
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index,"0",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("noReplyData",array1);
|
|
|
JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("replyData",array2);
|
|
|
JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("commingData",array3);
|
|
|
JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("endData",array4);
|
|
|
}else {
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("totalData",array);
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");
|
|
|
object.put("noReceiveData",array1);
|
|
|
JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("haveReceiveData",array2);
|
|
|
JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"-1");
|
|
|
object.put("concleData",array3);
|
|
|
JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"3");
|
|
|
object.put("endData",array4);
|
|
|
if (interval == 1) {
|
|
|
if (index.equalsIgnoreCase("6")) {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index1, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("totalData", array);//新增量
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate, endDate, area, level, index, "0", SaveModel.timeLevel_ZL, null);//未回复
|
|
|
object.put("noReplyData", array1);//未回复
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, null);//已回复
|
|
|
object.put("replyData", array2);//已回复
|
|
|
JSONArray array3 = dateTotalStatistics2(startDate, endDate, area, level, index1, "0", SaveModel.timeLevel_ZL, null);//进行中
|
|
|
object.put("commingData", array3);//进行中
|
|
|
JSONArray array4 = dateTotalStatistics2(startDate, endDate, area, level, index1, "1", SaveModel.timeLevel_ZL, null);//已完成
|
|
|
object.put("endData", array4);//已完成
|
|
|
} else {
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("totalData", array);//新增量
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, "0");//未接诊
|
|
|
object.put("noReceiveData", array1);//未接诊
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, "1");//已接诊
|
|
|
object.put("haveReceiveData", array2);//已接诊
|
|
|
JSONArray array3 = dateTotalStatistics2(startDate, endDate, area, level, index, lowCode, SaveModel.timeLevel_ZL, "-1");//患者取消
|
|
|
object.put("concleData", array3);//患者取消
|
|
|
JSONArray array4 = dateTotalStatistics2(startDate, endDate, area, level, index, lowCode, SaveModel.timeLevel_ZL, "3");//已结束
|
|
|
object.put("endData", array4);//已结束
|
|
|
}
|
|
|
|
|
|
} else if (interval == 2) {
|
|
|
if (index.equalsIgnoreCase("6")) {
|
|
|
JSONArray array = weekTotalStatistics8(startDate, endDate, area, level, index1, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("totalData", array);//新增量
|
|
|
JSONArray array1 = weekTotalStatistics7(startDate, endDate, area, level, index, "0", SaveModel.timeLevel_ZL);//未回复
|
|
|
object.put("noReplyData", array1);
|
|
|
;//未回复
|
|
|
JSONArray array2 = weekTotalStatistics7(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL);//已回复
|
|
|
object.put("replyData", array2);//已回复
|
|
|
JSONArray array3 = weekTotalStatistics7(startDate, endDate, area, level, index1, "0", SaveModel.timeLevel_ZL);//进行中
|
|
|
object.put("commingData", array3);//进行中
|
|
|
JSONArray array4 = weekTotalStatistics7(startDate, endDate, area, level, index1, "1", SaveModel.timeLevel_ZL);//已完成
|
|
|
object.put("endData", array3);//进行中
|
|
|
} else {
|
|
|
JSONArray array = weekTotalStatistics8(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("totalData", array);//新增量
|
|
|
JSONArray array1 = weekTotalStatistics8(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, "0");//未接诊
|
|
|
object.put("noReceiveData", array1);
|
|
|
;//未接诊
|
|
|
JSONArray array2 = weekTotalStatistics8(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, "1");//已接诊
|
|
|
object.put("haveReceiveData", array2);//已接诊
|
|
|
JSONArray array3 = weekTotalStatistics8(startDate, endDate, area, level, index, lowCode, SaveModel.timeLevel_ZL, "-1");//患者取消
|
|
|
object.put("concleData", array3);//患者取消
|
|
|
JSONArray array4 = weekTotalStatistics8(startDate, endDate, area, level, index, lowCode, SaveModel.timeLevel_ZL, "3");//已结束
|
|
|
object.put("endData", array4);//已结束
|
|
|
}
|
|
|
|
|
|
} else if (interval == 3) {
|
|
|
if (index.equalsIgnoreCase("6")) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, index1, null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("totalData", array);
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate, endDate, area, level, index, "0", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("noReplyData", array1);
|
|
|
JSONArray array2 = monthTotalStatistics2(startDate, endDate, area, level, index, "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("replyData", array2);
|
|
|
JSONArray array3 = monthTotalStatistics2(startDate, endDate, area, level, index1, "0", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("commingData", array3);
|
|
|
JSONArray array4 = monthTotalStatistics2(startDate, endDate, area, level, index1, "1", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("endData", array4);
|
|
|
} else {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("totalData", array);
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, "0");
|
|
|
object.put("noReceiveData", array1);
|
|
|
JSONArray array2 = monthTotalStatistics2(startDate, endDate, area, level, index1, lowCode, SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("haveReceiveData", array2);
|
|
|
JSONArray array3 = monthTotalStatistics2(startDate, endDate, area, level, index, lowCode, SaveModel.timeLevel_ZL, "-1");
|
|
|
object.put("concleData", array3);
|
|
|
JSONArray array4 = monthTotalStatistics2(startDate, endDate, area, level, index, lowCode, SaveModel.timeLevel_ZL, "3");
|
|
|
object.put("endData", array4);
|
|
|
}
|
|
|
|
|
|
}
|
|
@ -4119,46 +4129,47 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 咨询统计表格-PC
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @param level
|
|
|
* @param area
|
|
|
* @param lowLevel
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getConsultingListPC(String startTime,String endTime,int level, String area, String lowLevel,String index,String lowCode) throws Exception {
|
|
|
public JSONObject getConsultingListPC(String startTime, String endTime, int level, String area, String lowLevel, String index, String lowCode) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
String index1= (Integer.parseInt(index)+1)+"";
|
|
|
String index1 = (Integer.parseInt(index) + 1) + "";
|
|
|
// timeKey= "2017-11-01 00:00:00";
|
|
|
if(index.equalsIgnoreCase("6")){
|
|
|
if (index.equalsIgnoreCase("6")) {
|
|
|
//已结束
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,lowCode,"1");
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, lowCode, "1");
|
|
|
//进行中
|
|
|
List<SaveModel> comingTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"0");
|
|
|
List<SaveModel> comingTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, "0");
|
|
|
//咨询总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
|
|
|
//未回复数
|
|
|
List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
|
|
|
List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel, "0");
|
|
|
//已回复数
|
|
|
List<SaveModel> relyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1");
|
|
|
result.put("resultList", getCoutListPC(level, lowLevel, endTotal, total, noRelyTotal,relyTotal,comingTotal));
|
|
|
}else {
|
|
|
List<SaveModel> relyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel, "1");
|
|
|
result.put("resultList", getCoutListPC(level, lowLevel, endTotal, total, noRelyTotal, relyTotal, comingTotal));
|
|
|
} else {
|
|
|
//已结束
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,lowCode,"3");
|
|
|
List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel, lowCode, "3");
|
|
|
//居民取消
|
|
|
List<SaveModel> concleTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,lowCode,"-1");
|
|
|
List<SaveModel> concleTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel, lowCode, "-1");
|
|
|
//咨询总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,lowCode);
|
|
|
logger.info("total"+total==null?"0":String.valueOf(total.size())+";"+total.get(0).getResult1());
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, lowCode);
|
|
|
logger.info("total" + total == null ? "0" : String.valueOf(total.size()) + ";" + total.get(0).getResult1());
|
|
|
//已接诊
|
|
|
List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,lowCode,"1");
|
|
|
List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, lowCode, "1");
|
|
|
//未接诊
|
|
|
List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,lowCode,"0");
|
|
|
logger.info("noReceiveTotal"+noReceiveTotal==null?"0":String.valueOf(noReceiveTotal.size())+";"+noReceiveTotal.get(0).getResult1());
|
|
|
result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal,noReceiveTotal,concleTotal));
|
|
|
}
|
|
|
List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel, lowCode, "0");
|
|
|
logger.info("noReceiveTotal" + noReceiveTotal == null ? "0" : String.valueOf(noReceiveTotal.size()) + ";" + noReceiveTotal.get(0).getResult1());
|
|
|
result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal, noReceiveTotal, concleTotal));
|
|
|
}
|
|
|
|
|
|
|
|
|
return result;
|
|
@ -4166,13 +4177,14 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 在线复诊、协同复诊转换
|
|
|
*
|
|
|
* @param level
|
|
|
* @param lowLevel
|
|
|
* @param endConsult
|
|
|
* @param total
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> getCoutListPC1(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> haveReceive,List<SaveModel> noReceive,List<SaveModel> concle) {
|
|
|
public List<Map<String, Object>> getCoutListPC1(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> haveReceive, List<SaveModel> noReceive, List<SaveModel> concle) {
|
|
|
Map<String, Object> endMap = new HashMap<>();
|
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
|
Map<String, Object> noReceiveMap = new HashMap<>();
|
|
@ -4187,7 +4199,7 @@ public class StatisticsEsService {
|
|
|
endMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
endMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
endMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4198,7 +4210,7 @@ public class StatisticsEsService {
|
|
|
haveReceiveMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
haveReceiveMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
haveReceiveMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4210,7 +4222,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4221,7 +4233,7 @@ public class StatisticsEsService {
|
|
|
noReceiveMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
noReceiveMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
noReceiveMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4232,7 +4244,7 @@ public class StatisticsEsService {
|
|
|
concleMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
concleMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
concleMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4246,11 +4258,11 @@ public class StatisticsEsService {
|
|
|
SaveModel concleRs = (SaveModel) concleMap.get(key);
|
|
|
SaveModel noReceiveRs = (SaveModel) noReceiveMap.get(key);
|
|
|
SaveModel haveReceiveRs = (SaveModel) haveReceiveMap.get(key);
|
|
|
endRs = endRs==null?new SaveModel():endRs;
|
|
|
totalRs = totalRs==null?new SaveModel():totalRs;
|
|
|
concleRs = concleRs==null?new SaveModel():concleRs;
|
|
|
noReceiveRs = noReceiveRs==null?new SaveModel():noReceiveRs;
|
|
|
haveReceiveRs = haveReceiveRs==null?new SaveModel():haveReceiveRs;
|
|
|
endRs = endRs == null ? new SaveModel() : endRs;
|
|
|
totalRs = totalRs == null ? new SaveModel() : totalRs;
|
|
|
concleRs = concleRs == null ? new SaveModel() : concleRs;
|
|
|
noReceiveRs = noReceiveRs == null ? new SaveModel() : noReceiveRs;
|
|
|
haveReceiveRs = haveReceiveRs == null ? new SaveModel() : haveReceiveRs;
|
|
|
/*if (endRs == null || totalRs == null || concleRs == null || noReceiveRs==null || haveReceiveRs == null) {
|
|
|
continue;
|
|
|
}*/
|
|
@ -4290,13 +4302,14 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 文章数据转换
|
|
|
*
|
|
|
* @param level
|
|
|
* @param lowLevel
|
|
|
* @param
|
|
|
* @param total
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> getArticleCoutList(Integer level, String lowLevel, List<SaveModel> publishType, List<SaveModel> total, List<SaveModel> pinlun,List<SaveModel> dianzang,List<SaveModel> collect) {
|
|
|
public List<Map<String, Object>> getArticleCoutList(Integer level, String lowLevel, List<SaveModel> publishType, List<SaveModel> total, List<SaveModel> pinlun, List<SaveModel> dianzang, List<SaveModel> collect) {
|
|
|
Map<String, Object> publishTypeMap = new HashMap<>();
|
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
|
Map<String, Object> pinglunMap = new HashMap<>();
|
|
@ -4311,7 +4324,7 @@ public class StatisticsEsService {
|
|
|
publishTypeMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
publishTypeMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
publishTypeMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4322,7 +4335,7 @@ public class StatisticsEsService {
|
|
|
pinglunMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
pinglunMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
pinglunMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4334,7 +4347,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4345,7 +4358,7 @@ public class StatisticsEsService {
|
|
|
dianzangMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
dianzangMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
dianzangMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4356,7 +4369,7 @@ public class StatisticsEsService {
|
|
|
collectMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
collectMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
collectMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4370,11 +4383,11 @@ public class StatisticsEsService {
|
|
|
SaveModel pinglunRs = (SaveModel) pinglunMap.get(key);
|
|
|
SaveModel dianzangRs = (SaveModel) dianzangMap.get(key);
|
|
|
SaveModel collectRs = (SaveModel) collectMap.get(key);
|
|
|
publishTypeRs = publishTypeRs==null?new SaveModel():publishTypeRs;
|
|
|
totalRs = totalRs==null?new SaveModel():totalRs;
|
|
|
pinglunRs = pinglunRs==null?new SaveModel():pinglunRs;
|
|
|
dianzangRs = dianzangRs==null?new SaveModel():dianzangRs;
|
|
|
collectRs = collectRs==null?new SaveModel():collectRs;
|
|
|
publishTypeRs = publishTypeRs == null ? new SaveModel() : publishTypeRs;
|
|
|
totalRs = totalRs == null ? new SaveModel() : totalRs;
|
|
|
pinglunRs = pinglunRs == null ? new SaveModel() : pinglunRs;
|
|
|
dianzangRs = dianzangRs == null ? new SaveModel() : dianzangRs;
|
|
|
collectRs = collectRs == null ? new SaveModel() : collectRs;
|
|
|
/*if (endRs == null || totalRs == null || concleRs == null || noReceiveRs==null || haveReceiveRs == null) {
|
|
|
continue;
|
|
|
}*/
|
|
@ -4410,7 +4423,7 @@ public class StatisticsEsService {
|
|
|
return resultMaps;
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getCoutListPC(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> noRely,List<SaveModel> reply,List<SaveModel> coming) {
|
|
|
public List<Map<String, Object>> getCoutListPC(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> noRely, List<SaveModel> reply, List<SaveModel> coming) {
|
|
|
Map<String, Object> endMap = new HashMap<>();
|
|
|
Map<String, Object> totalMap = new HashMap<>();
|
|
|
Map<String, Object> noRelyMap = new HashMap<>();
|
|
@ -4425,7 +4438,7 @@ public class StatisticsEsService {
|
|
|
endMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
endMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
endMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4436,7 +4449,7 @@ public class StatisticsEsService {
|
|
|
comingMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
comingMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
comingMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4448,7 +4461,7 @@ public class StatisticsEsService {
|
|
|
totalMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
totalMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4459,7 +4472,7 @@ public class StatisticsEsService {
|
|
|
noRelyMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
noRelyMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
noRelyMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4470,7 +4483,7 @@ public class StatisticsEsService {
|
|
|
relyMap.put(saveModel.getDoctor(), saveModel);
|
|
|
} else if (SaveModel.deptLevel.equals(low_level)) {
|
|
|
relyMap.put(saveModel.getDept(), saveModel);
|
|
|
}else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
relyMap.put(saveModel.getHospital(), saveModel);
|
|
|
}
|
|
|
}
|
|
@ -4485,7 +4498,7 @@ public class StatisticsEsService {
|
|
|
SaveModel relyRs = (SaveModel) relyMap.get(key);
|
|
|
SaveModel comingRs = (SaveModel) relyMap.get(key);
|
|
|
|
|
|
if (endRs == null || totalRs == null || onRelyRs == null || relyRs==null || comingRs == null) {
|
|
|
if (endRs == null || totalRs == null || onRelyRs == null || relyRs == null || comingRs == null) {
|
|
|
continue;
|
|
|
}
|
|
|
//合并结果集
|
|
@ -4547,49 +4560,45 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level
|
|
|
* @param index 6专家,13协同,17、在线复诊
|
|
|
* @param index 6专家,13协同,17、在线复诊
|
|
|
* @param timeLevel
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getIndexTotalApp(String startDate, String endDate, String area, int level, String index,String timeLevel) throws Exception {
|
|
|
public JSONObject getIndexTotalApp(String startDate, String endDate, String area, int level, String index, String timeLevel) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
String str[] = new String[]{};
|
|
|
if (StringUtils.isNoneBlank(index)){
|
|
|
str =index.split(",");
|
|
|
if (StringUtils.isNoneBlank(index)) {
|
|
|
str = index.split(",");
|
|
|
}
|
|
|
for (int i=0;i<str.length;i++){
|
|
|
String index1 = (Integer.parseInt(str[i])+1)+"";
|
|
|
if (index1.equalsIgnoreCase("12")){
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
String index1 = (Integer.parseInt(str[i]) + 1) + "";
|
|
|
if (index1.equalsIgnoreCase("12")) {
|
|
|
SaveModel saveModel1 = null;//图文
|
|
|
SaveModel saveModel2 = null;//视频
|
|
|
if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_ZL)){
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level,"12" , SaveModel.timeLevel_ZL,"9");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level,"16" , SaveModel.timeLevel_ZL,"16");
|
|
|
}else if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_DDL)){
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level,"12" , SaveModel.timeLevel_DDL,"9");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level,"16" , SaveModel.timeLevel_DDL,"16");
|
|
|
if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_ZL)) {
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "9");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "16");
|
|
|
} else if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_DDL)) {
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, "12", SaveModel.timeLevel_DDL, "9");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, "16", SaveModel.timeLevel_DDL, "16");
|
|
|
}
|
|
|
Double topicTotal = saveModel1.getResult1();
|
|
|
Double vedioTotal = saveModel2.getResult1();
|
|
|
object.put("index_11_15",vedioTotal+topicTotal);//在线复诊
|
|
|
}else {
|
|
|
object.put("index_11_15", vedioTotal + topicTotal);//在线复诊
|
|
|
} else {
|
|
|
SaveModel saveModel = null;
|
|
|
if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_ZL)){
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level,index1 , SaveModel.timeLevel_ZL);
|
|
|
}else if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_DDL)){
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level,index1 , SaveModel.timeLevel_DDL);
|
|
|
if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_ZL)) {
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL);
|
|
|
} else if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_DDL)) {
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, index1, SaveModel.timeLevel_DDL);
|
|
|
}
|
|
|
object.put("index_"+str[i],saveModel.getResult1());
|
|
|
object.put("index_" + str[i], saveModel.getResult1());
|
|
|
}
|
|
|
|
|
|
}
|
|
@ -4599,225 +4608,224 @@ public class StatisticsEsService {
|
|
|
/**
|
|
|
* 按日期柱状图统计处方量
|
|
|
*
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level 2科室
|
|
|
* @param level 2科室
|
|
|
* @param index
|
|
|
* @param level2_type 4 医院
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getPrescriptionLineBy(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
|
|
|
public JSONObject getPrescriptionLineBy(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:" + index + " and level2_type:" + level2_type + " and level:" + level);
|
|
|
String[] indexes = index.split(",");
|
|
|
String index3 = indexes.length>=3?indexes[2]:"20";
|
|
|
String index3 = indexes.length >= 3 ? indexes[2] : "20";
|
|
|
JSONArray resultArray = new JSONArray();
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
if (interval == 1) {
|
|
|
//图文
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("data",array);
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("data", array);
|
|
|
//视频
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("data2",array1);
|
|
|
JSONArray arraytotal = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data3",arraytotal);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"1");
|
|
|
JSONArray array1 = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"2");
|
|
|
JSONArray arraytotal = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
object.put("data2",array1);
|
|
|
object.put("data3",arraytotal);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"1");
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,"2");
|
|
|
JSONArray arraytotal = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data",array);
|
|
|
object.put("data2",array1);
|
|
|
object.put("data3",arraytotal);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(level2_type)){
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("data2", array1);
|
|
|
JSONArray arraytotal = dateTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data3", arraytotal);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, "1");
|
|
|
JSONArray array1 = weekTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, "2");
|
|
|
JSONArray arraytotal = weekTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
object.put("data2", array1);
|
|
|
object.put("data3", arraytotal);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, "1");
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, "2");
|
|
|
JSONArray arraytotal = monthTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data", array);
|
|
|
object.put("data2", array1);
|
|
|
object.put("data3", arraytotal);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(level2_type)) {
|
|
|
//问诊量表格
|
|
|
List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL,"","",level2_type);
|
|
|
List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL, "", "", level2_type);
|
|
|
//开具处方数量
|
|
|
Double preNum = 0.0;
|
|
|
Double outNum = 0.0;
|
|
|
Double isPayNum = 0.0;//已支付的处方数量
|
|
|
String prescriptionRate ="";
|
|
|
String prescriptionRate = "";
|
|
|
String prescriptionPayRate = "";
|
|
|
List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"","",level2_type);
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","",level2_type);
|
|
|
List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", level2_type);
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL, "1", "", level2_type);
|
|
|
|
|
|
if(SaveModel.OrgLevel.equals(level2_type)){
|
|
|
for(SaveModel saveModel:precriptionList){
|
|
|
if (SaveModel.OrgLevel.equals(level2_type)) {
|
|
|
for (SaveModel saveModel : precriptionList) {
|
|
|
preNum = saveModel.getResult1();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("hospitalCode",saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName",saveModel.getHospitalName());
|
|
|
jsonObject.put("specialist",saveModel.getResult1());
|
|
|
for(SaveModel saveModel1:outpatientList){
|
|
|
String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
jsonObject.put("hospitalCode", saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName", saveModel.getHospitalName());
|
|
|
jsonObject.put("specialist", saveModel.getResult1());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out = saveModel1.getHospital() == null ? "" : saveModel1.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionRate",prescriptionRate);
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getHospital() == null ? "" : saveModel2.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getHospital()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getHospital()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if(SaveModel.doctorLevel.equals(level2_type)){
|
|
|
for(SaveModel saveModel:precriptionList){
|
|
|
if (SaveModel.doctorLevel.equals(level2_type)) {
|
|
|
for (SaveModel saveModel : precriptionList) {
|
|
|
preNum = saveModel.getResult1();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
String doctorCode = saveModel.getDoctor();
|
|
|
BaseDoctorDO baseDoctorDO = doctorDao.findByIdAndDel(doctorCode);
|
|
|
if(null!=baseDoctorDO){
|
|
|
jsonObject.put("jobTitleCode",baseDoctorDO.getJobTitleCode());
|
|
|
jsonObject.put("jobTitleName",baseDoctorDO.getJobTitleName());
|
|
|
if (null != baseDoctorDO) {
|
|
|
jsonObject.put("jobTitleCode", baseDoctorDO.getJobTitleCode());
|
|
|
jsonObject.put("jobTitleName", baseDoctorDO.getJobTitleName());
|
|
|
}
|
|
|
jsonObject.put("hospitalCode",saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName",saveModel.getHospitalName());
|
|
|
jsonObject.put("deptNo",saveModel.getDept());
|
|
|
jsonObject.put("deptName",saveModel.getDeptName());
|
|
|
jsonObject.put("specialist",saveModel.getResult1());
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("doctorCode",saveModel.getDoctor());
|
|
|
for(SaveModel saveModel1:outpatientList){
|
|
|
String outdoc=saveModel1.getDoctor()==null?"":saveModel1.getDoctor();
|
|
|
String predoc=saveModel.getDoctor()==null?"":saveModel.getDoctor();
|
|
|
if(outdoc.equalsIgnoreCase(predoc)){
|
|
|
jsonObject.put("hospitalCode", saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName", saveModel.getHospitalName());
|
|
|
jsonObject.put("deptNo", saveModel.getDept());
|
|
|
jsonObject.put("deptName", saveModel.getDeptName());
|
|
|
jsonObject.put("specialist", saveModel.getResult1());
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("doctorCode", saveModel.getDoctor());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String outdoc = saveModel1.getDoctor() == null ? "" : saveModel1.getDoctor();
|
|
|
String predoc = saveModel.getDoctor() == null ? "" : saveModel.getDoctor();
|
|
|
if (outdoc.equalsIgnoreCase(predoc)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionRate",prescriptionRate);
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getDoctor()==null?"":saveModel2.getDoctor();
|
|
|
String pre=saveModel.getDoctor()==null?"":saveModel.getDoctor();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getDoctor() == null ? "" : saveModel2.getDoctor();
|
|
|
String pre = saveModel.getDoctor() == null ? "" : saveModel.getDoctor();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getDoctor()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getDoctor()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if(SaveModel.deptLevel.equals(level2_type)){
|
|
|
for(SaveModel saveModel:precriptionList){
|
|
|
if (SaveModel.deptLevel.equals(level2_type)) {
|
|
|
for (SaveModel saveModel : precriptionList) {
|
|
|
preNum = saveModel.getResult1();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("hospitalCode",saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName",saveModel.getHospitalName());
|
|
|
jsonObject.put("deptNo",saveModel.getDept());
|
|
|
jsonObject.put("deptName",saveModel.getDeptName());
|
|
|
jsonObject.put("specialist",saveModel.getResult1());
|
|
|
for(SaveModel saveModel1:outpatientList){
|
|
|
String out=saveModel1.getDept()==null?"":saveModel1.getDept();
|
|
|
String pre=saveModel.getDept()==null?"":saveModel.getDept();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
jsonObject.put("hospitalCode", saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName", saveModel.getHospitalName());
|
|
|
jsonObject.put("deptNo", saveModel.getDept());
|
|
|
jsonObject.put("deptName", saveModel.getDeptName());
|
|
|
jsonObject.put("specialist", saveModel.getResult1());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out = saveModel1.getDept() == null ? "" : saveModel1.getDept();
|
|
|
String pre = saveModel.getDept() == null ? "" : saveModel.getDept();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionRate",prescriptionRate);
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getDept()==null?"":saveModel2.getDept();
|
|
|
String pre=saveModel.getDept()==null?"":saveModel.getDept();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getDept() == null ? "" : saveModel2.getDept();
|
|
|
String pre = saveModel.getDept() == null ? "" : saveModel.getDept();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getDept()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getDept()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}else {
|
|
|
} else {
|
|
|
//问诊量表格
|
|
|
List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL,"","","4");
|
|
|
List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL, "", "", "4");
|
|
|
//开具处方数量
|
|
|
Double preNum = 0.0;
|
|
|
Double outNum = 0.0;
|
|
|
Double isPayNum = 0.0;//已支付的处方数量
|
|
|
String prescriptionRate ="";
|
|
|
String prescriptionRate = "";
|
|
|
String prescriptionPayRate = "";
|
|
|
List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"","","4");
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","","4");
|
|
|
for(SaveModel saveModel:precriptionList){
|
|
|
List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", "4");
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL, "1", "", "4");
|
|
|
for (SaveModel saveModel : precriptionList) {
|
|
|
preNum = saveModel.getResult1();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("hospitalCode",saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName",saveModel.getHospitalName());
|
|
|
jsonObject.put("deptNo",saveModel.getDept());
|
|
|
jsonObject.put("deptName",saveModel.getDeptName());
|
|
|
jsonObject.put("specialist",saveModel.getResult1());
|
|
|
jsonObject.put("doctorName",saveModel.getDoctorName());
|
|
|
jsonObject.put("doctorCode",saveModel.getDoctor());
|
|
|
for(SaveModel saveModel1:outpatientList){
|
|
|
String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
jsonObject.put("hospitalCode", saveModel.getHospital());
|
|
|
jsonObject.put("hospitalName", saveModel.getHospitalName());
|
|
|
jsonObject.put("deptNo", saveModel.getDept());
|
|
|
jsonObject.put("deptName", saveModel.getDeptName());
|
|
|
jsonObject.put("specialist", saveModel.getResult1());
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("doctorCode", saveModel.getDoctor());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out = saveModel1.getHospital() == null ? "" : saveModel1.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(),outNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionRate",prescriptionRate);
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getHospital() == null ? "" : saveModel2.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getHospital()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getHospital()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
List<JSONObject> bindArrayResult = JSONArray.parseArray(resultArray.toJSONString(), JSONObject.class);
|
|
|
System.out.println("排序前:"+bindArrayResult);
|
|
|
System.out.println("排序前:" + bindArrayResult);
|
|
|
Collections.sort(bindArrayResult, new Comparator<JSONObject>() {
|
|
|
@Override
|
|
|
public int compare(JSONObject o1, JSONObject o2) {
|
|
@ -4825,59 +4833,59 @@ public class StatisticsEsService {
|
|
|
double b = o2.getDouble("specialist");
|
|
|
if (a > b) {
|
|
|
return -1;
|
|
|
} else if(a == b) {
|
|
|
} else if (a == b) {
|
|
|
return 0;
|
|
|
} else
|
|
|
return 1;
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = JSONArray.parseArray(bindArrayResult.toString());
|
|
|
object.put("excelData",jsonArray);
|
|
|
object.put("excelData", jsonArray);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 按日期柱状图 取药方式统计处方量
|
|
|
*
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
|
* @param level 2科室
|
|
|
* @param level 2科室
|
|
|
* @param index
|
|
|
* @param level2_type 4 医院
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getPrescriptionLineByType(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
|
|
|
public JSONObject getPrescriptionLineByType(String startDate, String endDate, String area, int level, String index, int interval, String level2_type) throws Exception {
|
|
|
logger.info("service index:" + index + " and level2_type:" + level2_type + " and level:" + level);
|
|
|
String[] indexes = index.split(",");
|
|
|
String index3 = indexes.length>=3?indexes[2]:"20";
|
|
|
String index3 = indexes.length >= 3 ? indexes[2] : "20";
|
|
|
JSONArray resultArray = new JSONArray();
|
|
|
//问诊量
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (interval==1){
|
|
|
if (interval == 1) {
|
|
|
//自取
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],"1",SaveModel.timeLevel_ZL,"");
|
|
|
object.put("data",array);
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, indexes[1], "1", SaveModel.timeLevel_ZL, "");
|
|
|
object.put("data", array);
|
|
|
//快递
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],"0",SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data2",array1);
|
|
|
JSONArray arraytotal = dateTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data3",arraytotal);
|
|
|
}else if (interval==2){
|
|
|
JSONArray array = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],"1",SaveModel.timeLevel_ZL,"");
|
|
|
JSONArray array1 = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],"0",SaveModel.timeLevel_ZL,"");
|
|
|
object.put("data",array);
|
|
|
object.put("data2",array1);
|
|
|
JSONArray arraytotal = weekTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data3",arraytotal);
|
|
|
}else if (interval==3){
|
|
|
JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],"1",SaveModel.timeLevel_ZL,"");
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],"0",SaveModel.timeLevel_ZL,"");
|
|
|
object.put("data",array);
|
|
|
object.put("data2",array1);
|
|
|
JSONArray arraytotal = monthTotalStatistics2(startDate,endDate,area,level,indexes[1],null,SaveModel.timeLevel_ZL,null);
|
|
|
object.put("data3",arraytotal);
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate, endDate, area, level, indexes[1], "0", SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data2", array1);
|
|
|
JSONArray arraytotal = dateTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data3", arraytotal);
|
|
|
} else if (interval == 2) {
|
|
|
JSONArray array = weekTotalStatistics2(startDate, endDate, area, level, indexes[1], "1", SaveModel.timeLevel_ZL, "");
|
|
|
JSONArray array1 = weekTotalStatistics2(startDate, endDate, area, level, indexes[1], "0", SaveModel.timeLevel_ZL, "");
|
|
|
object.put("data", array);
|
|
|
object.put("data2", array1);
|
|
|
JSONArray arraytotal = weekTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data3", arraytotal);
|
|
|
} else if (interval == 3) {
|
|
|
JSONArray array = monthTotalStatistics2(startDate, endDate, area, level, indexes[1], "1", SaveModel.timeLevel_ZL, "");
|
|
|
JSONArray array1 = monthTotalStatistics2(startDate, endDate, area, level, indexes[1], "0", SaveModel.timeLevel_ZL, "");
|
|
|
object.put("data", array);
|
|
|
object.put("data2", array1);
|
|
|
JSONArray arraytotal = monthTotalStatistics2(startDate, endDate, area, level, indexes[1], null, SaveModel.timeLevel_ZL, null);
|
|
|
object.put("data3", arraytotal);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(level2_type)) {
|
|
|
List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL, "", "", level2_type);
|
|
@ -4888,7 +4896,7 @@ public class StatisticsEsService {
|
|
|
String prescriptionRate = "";
|
|
|
String prescriptionPayRate = "";
|
|
|
List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", level2_type);
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","",level2_type);
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL, "1", "", level2_type);
|
|
|
if (SaveModel.OrgLevel.equals(level2_type)) {
|
|
|
//问诊量表格
|
|
|
for (SaveModel saveModel : precriptionList) {
|
|
@ -4898,28 +4906,28 @@ public class StatisticsEsService {
|
|
|
jsonObject.put("hospitalName", saveModel.getHospitalName());
|
|
|
jsonObject.put("specialist", saveModel.getResult1());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
String out = saveModel1.getHospital() == null ? "" : saveModel1.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getHospital() == null ? "" : saveModel2.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getHospital()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getHospital()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
@ -4936,28 +4944,28 @@ public class StatisticsEsService {
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("doctorCode", saveModel.getDoctor());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out=saveModel1.getDoctor()==null?"":saveModel1.getDoctor();
|
|
|
String pre=saveModel.getDoctor()==null?"":saveModel.getDoctor();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
String out = saveModel1.getDoctor() == null ? "" : saveModel1.getDoctor();
|
|
|
String pre = saveModel.getDoctor() == null ? "" : saveModel.getDoctor();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getDoctor()==null?"":saveModel2.getDoctor();
|
|
|
String pre=saveModel.getDoctor()==null?"":saveModel.getDoctor();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getDoctor() == null ? "" : saveModel2.getDoctor();
|
|
|
String pre = saveModel.getDoctor() == null ? "" : saveModel.getDoctor();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getDoctor()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getDoctor()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
@ -4974,34 +4982,34 @@ public class StatisticsEsService {
|
|
|
jsonObject.put("name", saveModel.getHospitalName());
|
|
|
jsonObject.put("specialist", saveModel.getResult1());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out=saveModel1.getDept()==null?"":saveModel1.getDept();
|
|
|
String pre=saveModel.getDept()==null?"":saveModel.getDept();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
String out = saveModel1.getDept() == null ? "" : saveModel1.getDept();
|
|
|
String pre = saveModel.getDept() == null ? "" : saveModel.getDept();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
for (SaveModel saveModel2:precriptionIsPayList){
|
|
|
String isPay=saveModel2.getDept()==null?"":saveModel2.getDept();
|
|
|
String pre=saveModel.getDept()==null?"":saveModel.getDept();
|
|
|
if(isPay.equalsIgnoreCase(pre)){
|
|
|
for (SaveModel saveModel2 : precriptionIsPayList) {
|
|
|
String isPay = saveModel2.getDept() == null ? "" : saveModel2.getDept();
|
|
|
String pre = saveModel.getDept() == null ? "" : saveModel.getDept();
|
|
|
if (isPay.equalsIgnoreCase(pre)) {
|
|
|
isPayNum = saveModel2.getResult1();
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
|
|
|
jsonObject.put("prescriptionPayRate",prescriptionPayRate);
|
|
|
prescriptionPayRate = getRange(isPayNum.intValue(), preNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionPayRate", prescriptionPayRate);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(null==saveModel.getDept()){
|
|
|
resultArray =new JSONArray();
|
|
|
}else {
|
|
|
if (null == saveModel.getDept()) {
|
|
|
resultArray = new JSONArray();
|
|
|
} else {
|
|
|
resultArray.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}else{
|
|
|
} else {
|
|
|
List<SaveModel> outpatientList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL, "", "", "4");
|
|
|
//开具处方数量
|
|
|
Double preNum = 0.0;
|
|
@ -5010,7 +5018,7 @@ public class StatisticsEsService {
|
|
|
String prescriptionRate = "";
|
|
|
String prescriptionPayRate = "";
|
|
|
List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", "4");
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","","4");
|
|
|
List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL, "1", "", "4");
|
|
|
for (SaveModel saveModel : precriptionList) {
|
|
|
preNum = saveModel.getResult1();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
@ -5022,9 +5030,9 @@ public class StatisticsEsService {
|
|
|
jsonObject.put("doctorName", saveModel.getDoctorName());
|
|
|
jsonObject.put("doctorCode", saveModel.getDoctor());
|
|
|
for (SaveModel saveModel1 : outpatientList) {
|
|
|
String out=saveModel1.getHospital()==null?"":saveModel1.getHospital();
|
|
|
String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
|
|
|
if(out.equalsIgnoreCase(pre)){
|
|
|
String out = saveModel1.getHospital() == null ? "" : saveModel1.getHospital();
|
|
|
String pre = saveModel.getHospital() == null ? "" : saveModel.getHospital();
|
|
|
if (out.equalsIgnoreCase(pre)) {
|
|
|
outNum = saveModel1.getResult1();
|
|
|
prescriptionRate = getRange(preNum.intValue(), outNum.intValue(), 0);
|
|
|
jsonObject.put("prescriptionRate", prescriptionRate);
|
|
@ -5054,6 +5062,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* app端头部收入统计
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -5061,7 +5070,7 @@ public class StatisticsEsService {
|
|
|
* @param index
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject appIndexHead(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
public JSONObject appIndexHead(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
String nowStartDate = DateUtil.getStringDateShort();
|
|
|
String monthStartDate = DateUtil.getFristDayOfMonth();
|
|
@ -5069,111 +5078,111 @@ public class StatisticsEsService {
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
//今日收入总收入
|
|
|
SaveModel nowPrice = elasticsearchUtil.findOneDateQuotaLevel0(nowStartDate, nowStartDate, area, level, index, SaveModel.timeLevel_ZL);
|
|
|
object.put("nowPrice",decimalFormat.format(nowPrice.getResult1()));
|
|
|
object.put("nowPrice", decimalFormat.format(nowPrice.getResult1()));
|
|
|
//本月总收入
|
|
|
SaveModel nowMonthPrice = elasticsearchUtil.findOneDateQuotaLevel0(monthStartDate, monthEndDate, area, level, index, SaveModel.timeLevel_ZL);
|
|
|
object.put("nowMonthPrice",decimalFormat.format(nowPrice.getResult1()));
|
|
|
object.put("nowMonthPrice", decimalFormat.format(nowPrice.getResult1()));
|
|
|
SaveModel totalPrice = elasticsearchUtil.findOneDateQuotaLevel0(nowStartDate, nowStartDate, area, level, index, SaveModel.timeLevel_DDL);
|
|
|
object.put("totalPrice",decimalFormat.format(totalPrice.getResult1()));
|
|
|
object.put("totalPrice", decimalFormat.format(totalPrice.getResult1()));
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject appIndexCenter(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
public JSONObject appIndexCenter(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
//图文复诊
|
|
|
SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL,"9");
|
|
|
object.put("topicTotal",topicTotal.getResult1());
|
|
|
SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "9");
|
|
|
object.put("topicTotal", topicTotal.getResult1());
|
|
|
//视频复诊
|
|
|
SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL,"16");
|
|
|
object.put("videoTotal",videoTotal.getResult1());
|
|
|
SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "16");
|
|
|
object.put("videoTotal", videoTotal.getResult1());
|
|
|
//专家咨询twzxData
|
|
|
SaveModel specialistTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("twzxTotal",specialistTotal.getResult1());
|
|
|
SaveModel specialistTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("twzxTotal", specialistTotal.getResult1());
|
|
|
//专家咨询twzxData
|
|
|
SaveModel specialistSPTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL,"17");
|
|
|
object.put("spzxTotal",specialistSPTotal.getResult1());
|
|
|
SaveModel specialistSPTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "17");
|
|
|
object.put("spzxTotal", specialistSPTotal.getResult1());
|
|
|
//专科协同
|
|
|
SaveModel synergyTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL,"12");
|
|
|
object.put("synergyTotal",synergyTotal.getResult1());
|
|
|
SaveModel synergyTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL, "12");
|
|
|
object.put("synergyTotal", synergyTotal.getResult1());
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
public JSONObject appPriceHead(String startDate, String endDate, String area,int level, String index) throws Exception {
|
|
|
public JSONObject appPriceHead(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
//图文复诊
|
|
|
SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1","1");
|
|
|
object.put("topicTotal",decimalFormat.format(topicTotal.getResult1()));
|
|
|
SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", "1");
|
|
|
object.put("topicTotal", decimalFormat.format(topicTotal.getResult1()));
|
|
|
//视频复诊
|
|
|
SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1","2");
|
|
|
object.put("videoTotal",decimalFormat.format(videoTotal.getResult1()));
|
|
|
SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", "2");
|
|
|
object.put("videoTotal", decimalFormat.format(videoTotal.getResult1()));
|
|
|
/*//专家咨询
|
|
|
SaveModel specialistTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"3");
|
|
|
object.put("specialistTotal",decimalFormat.format(specialistTotal.getResult1()));*/
|
|
|
//专家图文
|
|
|
SaveModel specialistTW = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"3","1");
|
|
|
object.put("specialistTW",decimalFormat.format(specialistTW.getResult1()));
|
|
|
SaveModel specialistTW = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", "1");
|
|
|
object.put("specialistTW", decimalFormat.format(specialistTW.getResult1()));
|
|
|
//专家视频
|
|
|
SaveModel specialistSP = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"3","2");
|
|
|
object.put("specialistSP",decimalFormat.format(specialistSP.getResult1()));
|
|
|
SaveModel specialistSP = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", "2");
|
|
|
object.put("specialistSP", decimalFormat.format(specialistSP.getResult1()));
|
|
|
|
|
|
//专科协同
|
|
|
SaveModel synergyTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("synergyTotal",decimalFormat.format(synergyTotal.getResult1()));
|
|
|
SaveModel synergyTotal = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("synergyTotal", decimalFormat.format(synergyTotal.getResult1()));
|
|
|
//总收入
|
|
|
SaveModel totalPrice = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL);
|
|
|
object.put("totalPrice",decimalFormat.format(totalPrice.getResult1()));
|
|
|
object.put("totalPrice", decimalFormat.format(totalPrice.getResult1()));
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
public JSONObject appPrescriptionHead(String startDate, String endDate, String area,int level, String index) throws Exception {
|
|
|
public JSONObject appPrescriptionHead(String startDate, String endDate, String area, int level, String index) throws Exception {
|
|
|
JSONObject object = new JSONObject();
|
|
|
//图文复诊
|
|
|
SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("topicTotal",topicTotal.getResult1());
|
|
|
SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("topicTotal", topicTotal.getResult1());
|
|
|
//视频复诊
|
|
|
SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"2");
|
|
|
object.put("videoTotal",videoTotal.getResult1());
|
|
|
SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "2");
|
|
|
object.put("videoTotal", videoTotal.getResult1());
|
|
|
//快递
|
|
|
SaveModel expressTotal = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"0");
|
|
|
object.put("express",expressTotal.getResult1());
|
|
|
SaveModel expressTotal = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "0");
|
|
|
object.put("express", expressTotal.getResult1());
|
|
|
//自取
|
|
|
SaveModel inviteTotal = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"1");
|
|
|
object.put("invite",inviteTotal.getResult1());
|
|
|
SaveModel inviteTotal = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
|
|
|
object.put("invite", inviteTotal.getResult1());
|
|
|
//总计
|
|
|
SaveModel specialistTotal = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL);
|
|
|
object.put("total",specialistTotal.getResult1());
|
|
|
object.put("total", specialistTotal.getResult1());
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject appCenterCircular(String startDate, String endDate, String area, int level, String index,String flag) throws Exception {
|
|
|
public JSONObject appCenterCircular(String startDate, String endDate, String area, int level, String index, String flag) throws Exception {
|
|
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (index.equalsIgnoreCase("3")||index.equalsIgnoreCase("3,21")||index.equalsIgnoreCase("21")){
|
|
|
if (index.equalsIgnoreCase("3") || index.equalsIgnoreCase("3,21") || index.equalsIgnoreCase("21")) {
|
|
|
//协同门诊
|
|
|
SaveModel saveModel1 = null;
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "2");
|
|
|
//图文复诊
|
|
|
SaveModel saveModel2 = null;
|
|
|
//saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1","1");
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", "1");
|
|
|
//视频复诊
|
|
|
SaveModel saveModel3 = null;
|
|
|
/*
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
|
|
|
*/
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1","2");
|
|
|
Double specialistCount =0.0;
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1", "2");
|
|
|
Double specialistCount = 0.0;
|
|
|
//专科咨询
|
|
|
SaveModel saveModel4 = null;
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3","1");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", "1");
|
|
|
specialistCount = saveModel4.getResult1();//专家咨询TW数量
|
|
|
Double specialistCountSP =0.0;
|
|
|
Double specialistCountSP = 0.0;
|
|
|
//专科咨询
|
|
|
SaveModel saveModel6 = null;
|
|
|
saveModel6 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3","2");
|
|
|
saveModel6 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "3", "2");
|
|
|
specialistCountSP = saveModel6.getResult1();//专家咨询SP数量
|
|
|
|
|
|
|
|
@ -5187,20 +5196,20 @@ public class StatisticsEsService {
|
|
|
Double videoCount = saveModel3.getResult1();//视频复诊数量
|
|
|
Double total = saveModel5.getResult1();//总量
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
object.put("specialistCount",decimalFormat.format(specialistCount));//专家咨询数
|
|
|
object.put("specialistSPCount",decimalFormat.format(specialistCountSP));//专家咨询视频数
|
|
|
object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
|
|
|
object.put("specialistSPRate",getRange(specialistCountSP.intValue(),total.intValue(),0));
|
|
|
object.put("synergyCount",decimalFormat.format(synergyCount));//专家咨询数
|
|
|
object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
|
|
|
object.put("topicCount",decimalFormat.format(topicCount));//图文复诊数量
|
|
|
object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
|
|
|
object.put("videoCount",decimalFormat.format(videoCount));//视频复诊数量
|
|
|
object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
|
|
|
object.put("total",decimalFormat.format(total));
|
|
|
|
|
|
}else if (index.equalsIgnoreCase("20")){
|
|
|
if (flag.equalsIgnoreCase("1")){
|
|
|
object.put("specialistCount", decimalFormat.format(specialistCount));//专家咨询数
|
|
|
object.put("specialistSPCount", decimalFormat.format(specialistCountSP));//专家咨询视频数
|
|
|
object.put("specialistRate", getRange(specialistCount.intValue(), total.intValue(), 0));
|
|
|
object.put("specialistSPRate", getRange(specialistCountSP.intValue(), total.intValue(), 0));
|
|
|
object.put("synergyCount", decimalFormat.format(synergyCount));//专家咨询数
|
|
|
object.put("synergyRate", getRange(synergyCount.intValue(), total.intValue(), 0));
|
|
|
object.put("topicCount", decimalFormat.format(topicCount));//图文复诊数量
|
|
|
object.put("topicRate", getRange(topicCount.intValue(), total.intValue(), 0));
|
|
|
object.put("videoCount", decimalFormat.format(videoCount));//视频复诊数量
|
|
|
object.put("videoRate", getRange(videoCount.intValue(), total.intValue(), 0));
|
|
|
object.put("total", decimalFormat.format(total));
|
|
|
|
|
|
} else if (index.equalsIgnoreCase("20")) {
|
|
|
if (flag.equalsIgnoreCase("1")) {
|
|
|
//图文复诊
|
|
|
SaveModel saveModel2 = null;
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
|
|
@ -5213,12 +5222,12 @@ public class StatisticsEsService {
|
|
|
Double topicCount = saveModel2.getResult1();//图文复诊数量
|
|
|
Double videoCount = saveModel3.getResult1();//视频复诊数量
|
|
|
Double total = saveModel1.getResult1();//总量
|
|
|
object.put("topicCount",topicCount);//图文复诊数量
|
|
|
object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
|
|
|
object.put("videoCount",videoCount);//视频复诊数量
|
|
|
object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
|
|
|
object.put("total",total);
|
|
|
}else if (flag.equalsIgnoreCase("2")){
|
|
|
object.put("topicCount", topicCount);//图文复诊数量
|
|
|
object.put("topicRate", getRange(topicCount.intValue(), total.intValue(), 0));
|
|
|
object.put("videoCount", videoCount);//视频复诊数量
|
|
|
object.put("videoRate", getRange(videoCount.intValue(), total.intValue(), 0));
|
|
|
object.put("total", total);
|
|
|
} else if (flag.equalsIgnoreCase("2")) {
|
|
|
//快递
|
|
|
SaveModel saveModel2 = null;
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "0");
|
|
@ -5231,11 +5240,11 @@ public class StatisticsEsService {
|
|
|
Double topicCount = saveModel2.getResult1();//图文复诊数量
|
|
|
Double videoCount = saveModel3.getResult1();//视频复诊数量
|
|
|
Double total = saveModel1.getResult1();//总量
|
|
|
object.put("express",topicCount);//快递数量
|
|
|
object.put("expressRate",getRange(topicCount.intValue(),total.intValue(),0));
|
|
|
object.put("invite",videoCount);//自取数量
|
|
|
object.put("inviteRate",getRange(videoCount.intValue(),total.intValue(),0));
|
|
|
object.put("total",total);
|
|
|
object.put("express", topicCount);//快递数量
|
|
|
object.put("expressRate", getRange(topicCount.intValue(), total.intValue(), 0));
|
|
|
object.put("invite", videoCount);//自取数量
|
|
|
object.put("inviteRate", getRange(videoCount.intValue(), total.intValue(), 0));
|
|
|
object.put("total", total);
|
|
|
}
|
|
|
|
|
|
|
|
@ -5337,7 +5346,7 @@ public class StatisticsEsService {
|
|
|
JSONObject range = new JSONObject();
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
countResult.put(endStr, range);
|
|
|
|
|
|
|
|
@ -5372,34 +5381,34 @@ public class StatisticsEsService {
|
|
|
Calendar quotaDate = Calendar.getInstance();
|
|
|
quotaDate.setTime(saveModel.getQuotaDate());
|
|
|
int thisWeek = quotaDate.get(Calendar.DAY_OF_WEEK);
|
|
|
switch (thisWeek){
|
|
|
switch (thisWeek) {
|
|
|
case 1:
|
|
|
thisWeek =7;
|
|
|
thisWeek = 7;
|
|
|
break;
|
|
|
case 2:
|
|
|
thisWeek =1;
|
|
|
thisWeek = 1;
|
|
|
break;
|
|
|
case 3:
|
|
|
thisWeek =2;
|
|
|
thisWeek = 2;
|
|
|
break;
|
|
|
case 4:
|
|
|
thisWeek =3;
|
|
|
thisWeek = 3;
|
|
|
break;
|
|
|
case 5:
|
|
|
thisWeek =4;
|
|
|
thisWeek = 4;
|
|
|
break;
|
|
|
case 6:
|
|
|
thisWeek =5;
|
|
|
thisWeek = 5;
|
|
|
break;
|
|
|
case 7:
|
|
|
thisWeek =6;
|
|
|
thisWeek = 6;
|
|
|
break;
|
|
|
}
|
|
|
int thisIncre = 7 - thisWeek;
|
|
|
quotaDate.add(Calendar.DATE, thisIncre);
|
|
|
if(quotaDate.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))){
|
|
|
if (quotaDate.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
|
|
|
range = df.format(quotaDate.getTime());
|
|
|
}else {
|
|
|
} else {
|
|
|
range = df.format(DateUtil.strToDate(endDate, "yyyy-MM-dd"));
|
|
|
}
|
|
|
|
|
@ -5415,8 +5424,8 @@ public class StatisticsEsService {
|
|
|
double num = saveModel.getResult1();
|
|
|
long previousAmount = Long.valueOf(json.get("amount").toString());
|
|
|
double previousNum = Double.parseDouble(json.get("num").toString());
|
|
|
json.put("amount", amount+previousAmount);
|
|
|
json.put("num",decimalFormat.format(num+previousNum));
|
|
|
json.put("amount", amount + previousAmount);
|
|
|
json.put("num", decimalFormat.format(num + previousNum));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -5436,7 +5445,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -5446,8 +5455,10 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 两位小数
|
|
|
*
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param area
|
|
@ -5459,7 +5470,7 @@ public class StatisticsEsService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
private JSONArray weekTotalStatistics8(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
|
|
|
private JSONArray weekTotalStatistics8(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel, String lowCode2) throws Exception {
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
// 起始日期
|
|
@ -5541,7 +5552,7 @@ public class StatisticsEsService {
|
|
|
JSONObject range = new JSONObject();
|
|
|
range.put("range", endStr);
|
|
|
range.put("amount", 0);
|
|
|
range.put("num",0.00);
|
|
|
range.put("num", 0.00);
|
|
|
countResult.put(endStr, range);
|
|
|
|
|
|
|
|
@ -5564,16 +5575,15 @@ public class StatisticsEsService {
|
|
|
|
|
|
List<SaveModel> saveModels = new ArrayList<>();
|
|
|
if (StringUtils.isNotBlank(lowCode)) {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode,lowCode2);
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(lowCode2)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode);
|
|
|
}
|
|
|
|
|
|
}else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day,lowCode2);
|
|
|
}
|
|
|
else {
|
|
|
} else if (StringUtils.isNoneBlank(lowCode2) && StringUtils.isBlank(lowCode)) {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode2);
|
|
|
} else {
|
|
|
saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day);
|
|
|
}
|
|
|
|
|
@ -5586,34 +5596,34 @@ public class StatisticsEsService {
|
|
|
Calendar quotaDate = Calendar.getInstance();
|
|
|
quotaDate.setTime(saveModel.getQuotaDate());
|
|
|
int thisWeek = quotaDate.get(Calendar.DAY_OF_WEEK);
|
|
|
switch (thisWeek){
|
|
|
switch (thisWeek) {
|
|
|
case 1:
|
|
|
thisWeek =7;
|
|
|
thisWeek = 7;
|
|
|
break;
|
|
|
case 2:
|
|
|
thisWeek =1;
|
|
|
thisWeek = 1;
|
|
|
break;
|
|
|
case 3:
|
|
|
thisWeek =2;
|
|
|
thisWeek = 2;
|
|
|
break;
|
|
|
case 4:
|
|
|
thisWeek =3;
|
|
|
thisWeek = 3;
|
|
|
break;
|
|
|
case 5:
|
|
|
thisWeek =4;
|
|
|
thisWeek = 4;
|
|
|
break;
|
|
|
case 6:
|
|
|
thisWeek =5;
|
|
|
thisWeek = 5;
|
|
|
break;
|
|
|
case 7:
|
|
|
thisWeek =6;
|
|
|
thisWeek = 6;
|
|
|
break;
|
|
|
}
|
|
|
int thisIncre = 7 - thisWeek;
|
|
|
quotaDate.add(Calendar.DATE, thisIncre);
|
|
|
if(quotaDate.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))){
|
|
|
if (quotaDate.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
|
|
|
range = df.format(quotaDate.getTime());
|
|
|
}else {
|
|
|
} else {
|
|
|
range = df.format(DateUtil.strToDate(endDate, "yyyy-MM-dd"));
|
|
|
}
|
|
|
|
|
@ -5628,8 +5638,8 @@ public class StatisticsEsService {
|
|
|
double num = saveModel.getResult1();
|
|
|
long previousAmount = Long.valueOf(json.get("amount").toString());
|
|
|
double previousNum = Double.parseDouble(json.get("num").toString());
|
|
|
json.put("amount", amount+previousAmount);
|
|
|
json.put("num",decimalFormat.format(num+previousNum));
|
|
|
json.put("amount", amount + previousAmount);
|
|
|
json.put("num", decimalFormat.format(num + previousNum));
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -5649,7 +5659,7 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
});
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (JSONObject object:result){
|
|
|
for (JSONObject object : result) {
|
|
|
jsonArray.add(object);
|
|
|
}
|
|
|
|
|
@ -5662,15 +5672,16 @@ public class StatisticsEsService {
|
|
|
|
|
|
/**
|
|
|
* 医生圈-文章统计头部
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
*
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param area 区域编码 如 level2 area传市编码
|
|
|
* @param level 2 市 3区 4医院 5、科室 6医生
|
|
|
* @param endDate 结束时间
|
|
|
* @param area 区域编码 如 level2 area传市编码
|
|
|
* @param level 2 市 3区 4医院 5、科室 6医生
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getArticleTotalHead(Integer flag,String startDate, String endDate, String area, int level) throws Exception {
|
|
|
public JSONObject getArticleTotalHead(Integer flag, String startDate, String endDate, String area, int level) throws Exception {
|
|
|
//发布量
|
|
|
SaveModel saveModel = null;
|
|
|
//发布量环比;
|
|
@ -5689,23 +5700,23 @@ public class StatisticsEsService {
|
|
|
SaveModel saveModel7 = null;
|
|
|
//浏览量同比
|
|
|
SaveModel saveModel8 = null;
|
|
|
if (flag==1){
|
|
|
startDate = DateUtil.getFirstMonthDay() +" 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay()+" 23:59:59";
|
|
|
} else if (flag==2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(),-6)+" 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort()+" 23:59:59";
|
|
|
}else if (flag==3){
|
|
|
startDate = DateUtil.getCurrentYearStartTime()+" 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() +" 23:59:59";
|
|
|
if (flag == 1) {
|
|
|
startDate = DateUtil.getFirstMonthDay() + " 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay() + " 23:59:59";
|
|
|
} else if (flag == 2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(), -6) + " 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort() + " 23:59:59";
|
|
|
} else if (flag == 3) {
|
|
|
startDate = DateUtil.getCurrentYearStartTime() + " 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() + " 23:59:59";
|
|
|
}
|
|
|
//同比时间:
|
|
|
String sameStartDate= DateUtil.getYearDate(DateUtil.strToDate(startDate))+" 00:00:00";
|
|
|
String sameEndDate = DateUtil.getYearDate(DateUtil.strToDate(endDate))+" 23:59:59";
|
|
|
String sameStartDate = DateUtil.getYearDate(DateUtil.strToDate(startDate)) + " 00:00:00";
|
|
|
String sameEndDate = DateUtil.getYearDate(DateUtil.strToDate(endDate)) + " 23:59:59";
|
|
|
//环比时间:
|
|
|
int months = DateUtil.getMonthDiff(DateUtil.strToDateLong(startDate),DateUtil.strToDateLong(endDate));
|
|
|
String linkStartDate = DateUtil.getMonthDate(DateUtil.strToDateLong(startDate),-months);
|
|
|
String linkEndDate = DateUtil.getMonthDate(DateUtil.strToDateLong(endDate),-months);
|
|
|
int months = DateUtil.getMonthDiff(DateUtil.strToDateLong(startDate), DateUtil.strToDateLong(endDate));
|
|
|
String linkStartDate = DateUtil.getMonthDate(DateUtil.strToDateLong(startDate), -months);
|
|
|
String linkEndDate = DateUtil.getMonthDate(DateUtil.strToDateLong(endDate), -months);
|
|
|
JSONObject object = new JSONObject();
|
|
|
//发布量统计
|
|
|
saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL);
|
|
@ -5713,64 +5724,65 @@ public class StatisticsEsService {
|
|
|
saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(linkStartDate, linkEndDate, area, level, "75", SaveModel.timeLevel_ZL);
|
|
|
//发布量同比
|
|
|
saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(sameStartDate, sameEndDate, area, level, "75", SaveModel.timeLevel_ZL);
|
|
|
Integer publishTotal= saveModel!=null?saveModel.getResult1().intValue():0;
|
|
|
Integer publishLinkTotal = saveModel1!=null?saveModel1.getResult1().intValue():0;
|
|
|
Integer publishSameTotal = saveModel2!=null?saveModel2.getResult1().intValue():0;
|
|
|
object.put("publishTotal",publishTotal);//发布量
|
|
|
object.put("publishLink",getTwoRange(publishTotal-publishLinkTotal,publishLinkTotal,0));//环比
|
|
|
object.put("publishSame",getTwoRange(publishTotal-publishSameTotal,publishSameTotal,0));//同比
|
|
|
Integer publishTotal = saveModel != null ? saveModel.getResult1().intValue() : 0;
|
|
|
Integer publishLinkTotal = saveModel1 != null ? saveModel1.getResult1().intValue() : 0;
|
|
|
Integer publishSameTotal = saveModel2 != null ? saveModel2.getResult1().intValue() : 0;
|
|
|
object.put("publishTotal", publishTotal);//发布量
|
|
|
object.put("publishLink", getTwoRange(publishTotal - publishLinkTotal, publishLinkTotal, 0));//环比
|
|
|
object.put("publishSame", getTwoRange(publishTotal - publishSameTotal, publishSameTotal, 0));//同比
|
|
|
//收藏量统计
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL,null,"3");
|
|
|
saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, null, "3");
|
|
|
//收藏量环比
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel2(linkStartDate, linkEndDate, area, level, "76", SaveModel.timeLevel_ZL,null,"3");
|
|
|
saveModel4 = elasticsearchUtil.findOneDateQuotaLevel2(linkStartDate, linkEndDate, area, level, "76", SaveModel.timeLevel_ZL, null, "3");
|
|
|
//收藏量同比
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(sameStartDate, sameEndDate, area, level, "76", SaveModel.timeLevel_ZL,null,"3");
|
|
|
Integer collectTotal = saveModel3!=null?saveModel3.getResult1().intValue():0;
|
|
|
Integer collectLinkTotal = saveModel4!=null?saveModel4.getResult1().intValue():0;
|
|
|
Integer collectSameTotal = saveModel5!=null?saveModel5.getResult1().intValue():0;
|
|
|
object.put("collectTotal",collectTotal);//发布量
|
|
|
object.put("collectLink",getTwoRange(collectTotal-collectLinkTotal,collectLinkTotal,0));//环比
|
|
|
object.put("collectSame",getTwoRange(collectTotal-collectSameTotal,collectSameTotal,0));//同比
|
|
|
saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(sameStartDate, sameEndDate, area, level, "76", SaveModel.timeLevel_ZL, null, "3");
|
|
|
Integer collectTotal = saveModel3 != null ? saveModel3.getResult1().intValue() : 0;
|
|
|
Integer collectLinkTotal = saveModel4 != null ? saveModel4.getResult1().intValue() : 0;
|
|
|
Integer collectSameTotal = saveModel5 != null ? saveModel5.getResult1().intValue() : 0;
|
|
|
object.put("collectTotal", collectTotal);//发布量
|
|
|
object.put("collectLink", getTwoRange(collectTotal - collectLinkTotal, collectLinkTotal, 0));//环比
|
|
|
object.put("collectSame", getTwoRange(collectTotal - collectSameTotal, collectSameTotal, 0));//同比
|
|
|
//浏览量统计
|
|
|
saveModel6 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "77", SaveModel.timeLevel_ZL);
|
|
|
//浏览量环比
|
|
|
saveModel7 = elasticsearchUtil.findOneDateQuotaLevel0(linkStartDate, linkEndDate, area, level, "77", SaveModel.timeLevel_ZL);
|
|
|
//浏览量同比
|
|
|
saveModel8 = elasticsearchUtil.findOneDateQuotaLevel0(sameStartDate, sameEndDate, area, level, "77", SaveModel.timeLevel_ZL);
|
|
|
Integer browseTotal= saveModel6!=null?saveModel6.getResult1().intValue():0;
|
|
|
Integer browseLinkTotal = saveModel7!=null?saveModel7.getResult1().intValue():0;
|
|
|
Integer browseSameTotal = saveModel8!=null?saveModel8.getResult1().intValue():0;
|
|
|
object.put("browseTotal",browseTotal);//发布量
|
|
|
object.put("browseLinkTotal",getTwoRange(browseTotal-browseLinkTotal,browseLinkTotal,0));//环比
|
|
|
object.put("browseSameTotal",getTwoRange(browseTotal-browseSameTotal,browseSameTotal,0));//同比
|
|
|
Integer browseTotal = saveModel6 != null ? saveModel6.getResult1().intValue() : 0;
|
|
|
Integer browseLinkTotal = saveModel7 != null ? saveModel7.getResult1().intValue() : 0;
|
|
|
Integer browseSameTotal = saveModel8 != null ? saveModel8.getResult1().intValue() : 0;
|
|
|
object.put("browseTotal", browseTotal);//发布量
|
|
|
object.put("browseLinkTotal", getTwoRange(browseTotal - browseLinkTotal, browseLinkTotal, 0));//环比
|
|
|
object.put("browseSameTotal", getTwoRange(browseTotal - browseSameTotal, browseSameTotal, 0));//同比
|
|
|
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**\
|
|
|
/**
|
|
|
* \
|
|
|
* 发布量柱状图
|
|
|
*
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param lowLevel 下一级区域等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @return
|
|
|
*/
|
|
|
public List<SaveModel> getArticlePublishList(Integer flag,String startDate,String endDate,int level, String area, String lowLevel) throws Exception {
|
|
|
if (flag==1){
|
|
|
startDate = DateUtil.getFirstMonthDay() +" 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay()+" 23:59:59";
|
|
|
} else if (flag==2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(),-6)+" 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort()+" 23:59:59";
|
|
|
}else if (flag==3){
|
|
|
startDate = DateUtil.getCurrentYearStartTime()+" 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() +" 23:59:59";
|
|
|
}
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level,"75", SaveModel.timeLevel_ZL, lowLevel);
|
|
|
public List<SaveModel> getArticlePublishList(Integer flag, String startDate, String endDate, int level, String area, String lowLevel) throws Exception {
|
|
|
if (flag == 1) {
|
|
|
startDate = DateUtil.getFirstMonthDay() + " 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay() + " 23:59:59";
|
|
|
} else if (flag == 2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(), -6) + " 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort() + " 23:59:59";
|
|
|
} else if (flag == 3) {
|
|
|
startDate = DateUtil.getCurrentYearStartTime() + " 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() + " 23:59:59";
|
|
|
}
|
|
|
List<SaveModel> saveModels = elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel);
|
|
|
return saveModels;
|
|
|
}
|
|
|
|
|
@ -5778,69 +5790,70 @@ public class StatisticsEsService {
|
|
|
/**
|
|
|
* 文章互动情况
|
|
|
*
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getArticleOperateDateLine(Integer flag,String startDate,String endDate,int level, String area) throws Exception {
|
|
|
if (flag==1){
|
|
|
startDate = DateUtil.getFirstMonthDay() +" 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay()+" 23:59:59";
|
|
|
} else if (flag==2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(),-6)+" 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort()+" 23:59:59";
|
|
|
}else if (flag==3){
|
|
|
startDate = DateUtil.getCurrentYearStartTime()+" 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() +" 23:59:59";
|
|
|
public JSONObject getArticleOperateDateLine(Integer flag, String startDate, String endDate, int level, String area) throws Exception {
|
|
|
if (flag == 1) {
|
|
|
startDate = DateUtil.getFirstMonthDay() + " 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay() + " 23:59:59";
|
|
|
} else if (flag == 2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(), -6) + " 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort() + " 23:59:59";
|
|
|
} else if (flag == 3) {
|
|
|
startDate = DateUtil.getCurrentYearStartTime() + " 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() + " 23:59:59";
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
|
JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,"76","",SaveModel.timeLevel_ZL,"1");//评论
|
|
|
object.put("pinglunTotalList",array);
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,"76","",SaveModel.timeLevel_ZL,"2");//点赞
|
|
|
object.put("dianzangTotalList",array);
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,"76","",SaveModel.timeLevel_ZL,"3");//收藏
|
|
|
object.put("collectTotalList",array);
|
|
|
JSONArray array = dateTotalStatistics2(startDate, endDate, area, level, "76", "", SaveModel.timeLevel_ZL, "1");//评论
|
|
|
object.put("pinglunTotalList", array);
|
|
|
JSONArray array1 = dateTotalStatistics2(startDate, endDate, area, level, "76", "", SaveModel.timeLevel_ZL, "2");//点赞
|
|
|
object.put("dianzangTotalList", array);
|
|
|
JSONArray array2 = dateTotalStatistics2(startDate, endDate, area, level, "76", "", SaveModel.timeLevel_ZL, "3");//收藏
|
|
|
object.put("collectTotalList", array);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 全院统计
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
*
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param lowLevel
|
|
|
* @param lowCode
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Map<String,Object>> getArticleExcel(Integer flag,String startDate,String endDate,int level, String area, String lowLevel,String lowCode) throws Exception {
|
|
|
if (flag==1){
|
|
|
startDate = DateUtil.getFirstMonthDay() +" 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay()+" 23:59:59";
|
|
|
} else if (flag==2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(),-6)+" 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort()+" 23:59:59";
|
|
|
}else if (flag==3){
|
|
|
startDate = DateUtil.getCurrentYearStartTime()+" 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() +" 23:59:59";
|
|
|
public List<Map<String, Object>> getArticleExcel(Integer flag, String startDate, String endDate, int level, String area, String lowLevel, String lowCode) throws Exception {
|
|
|
if (flag == 1) {
|
|
|
startDate = DateUtil.getFirstMonthDay() + " 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay() + " 23:59:59";
|
|
|
} else if (flag == 2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(), -6) + " 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort() + " 23:59:59";
|
|
|
} else if (flag == 3) {
|
|
|
startDate = DateUtil.getCurrentYearStartTime() + " 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() + " 23:59:59";
|
|
|
}
|
|
|
//文章发布数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1Empty(startDate, endDate,area,level, "75", SaveModel.timeLevel_ZL, lowLevel,lowCode);//总数
|
|
|
List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1Empty(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel, lowCode);//总数
|
|
|
//发布类型
|
|
|
List<SaveModel> publishTypeTotal = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel,lowCode);//发布类型
|
|
|
List<SaveModel> publishTypeTotal = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel, lowCode);//发布类型
|
|
|
//文章评论数
|
|
|
List<SaveModel> pinlunTotal = elasticsearchUtil.findListDateQuotaLevel2Empty(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, lowLevel,lowCode,"1");//评论
|
|
|
List<SaveModel> pinlunTotal = elasticsearchUtil.findListDateQuotaLevel2Empty(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, lowLevel, lowCode, "1");//评论
|
|
|
//文章点赞数
|
|
|
List<SaveModel> dianzangTotal = elasticsearchUtil.findListDateQuotaLevel2Empty(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, lowLevel,lowCode,"2");//点赞
|
|
|
List<SaveModel> dianzangTotal = elasticsearchUtil.findListDateQuotaLevel2Empty(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, lowLevel, lowCode, "2");//点赞
|
|
|
//文章收藏数
|
|
|
List<SaveModel> collectTotal = elasticsearchUtil.findListDateQuotaLevel2Empty(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, lowLevel,lowCode,"3");//收藏
|
|
|
return getArticleCoutList(level,lowLevel,publishTypeTotal,total,pinlunTotal,dianzangTotal,collectTotal);
|
|
|
List<SaveModel> collectTotal = elasticsearchUtil.findListDateQuotaLevel2Empty(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, lowLevel, lowCode, "3");//收藏
|
|
|
return getArticleCoutList(level, lowLevel, publishTypeTotal, total, pinlunTotal, dianzangTotal, collectTotal);
|
|
|
}
|
|
|
|
|
|
|
|
@ -5900,52 +5913,51 @@ public class StatisticsEsService {
|
|
|
/**
|
|
|
* 文章类型统计
|
|
|
*
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param flag 0自定义 1本月2近半年3本年
|
|
|
* @param startDate 开始时间
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param endDate 结束时间
|
|
|
* @param level 等级 1 省 2 市 3 区县 4 机构 5团队
|
|
|
* @param area code 厦门市 350200 code 和level是对应的
|
|
|
* @param lowLevel
|
|
|
* @param lowCode
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getArticleTypeCircle(Integer flag,String startDate,String endDate,int level, String area, String lowLevel,String lowCode) throws Exception {
|
|
|
public JSONObject getArticleTypeCircle(Integer flag, String startDate, String endDate, int level, String area, String lowLevel, String lowCode) throws Exception {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if (flag==1){
|
|
|
startDate = DateUtil.getFirstMonthDay() +" 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay()+" 23:59:59";
|
|
|
} else if (flag==2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(),-6)+" 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort()+" 23:59:59";
|
|
|
}else if (flag==3){
|
|
|
startDate = DateUtil.getCurrentYearStartTime()+" 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() +" 23:59:59";
|
|
|
if (flag == 1) {
|
|
|
startDate = DateUtil.getFirstMonthDay() + " 00:00:00";
|
|
|
endDate = DateUtil.getLastMonthDay() + " 23:59:59";
|
|
|
} else if (flag == 2) {
|
|
|
startDate = DateUtil.getMonthDate(new Date(), -6) + " 00:00:00";
|
|
|
endDate = DateUtil.getStringDateShort() + " 23:59:59";
|
|
|
} else if (flag == 3) {
|
|
|
startDate = DateUtil.getCurrentYearStartTime() + " 00:00:00";
|
|
|
endDate = DateUtil.getCurrentYearEndTime() + " 23:59:59";
|
|
|
}
|
|
|
//文章发布数
|
|
|
SaveModel totalMap = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL);//总数
|
|
|
int total = 0;
|
|
|
if (totalMap!=null){
|
|
|
if (totalMap != null) {
|
|
|
|
|
|
}
|
|
|
//发布类型
|
|
|
List<SaveModel> publishTypeTotal = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel,lowCode);//发布类型
|
|
|
List<SaveModel> publishTypeTotal = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel, lowCode);//发布类型
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (SaveModel saveModel:publishTypeTotal){
|
|
|
for (SaveModel saveModel : publishTypeTotal) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("code",saveModel.getSlaveKey1());
|
|
|
object.put("name",saveModel.getSlaveKey1Name());
|
|
|
object.put("total",saveModel.getResult1());
|
|
|
object.put("rate",getTwoRange(saveModel.getResult1().intValue(),total, 0));
|
|
|
object.put("code", saveModel.getSlaveKey1());
|
|
|
object.put("name", saveModel.getSlaveKey1Name());
|
|
|
object.put("total", saveModel.getResult1());
|
|
|
object.put("rate", getTwoRange(saveModel.getResult1().intValue(), total, 0));
|
|
|
array.add(object);
|
|
|
}
|
|
|
jsonObject.put("total",total);
|
|
|
jsonObject.put("list",array);
|
|
|
jsonObject.put("total", total);
|
|
|
jsonObject.put("list", array);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 1自定义时间 2 本月 3 近半年 4 全年
|
|
|
* 【总收入】= 诊查费(21) + 处方费(3)
|
|
@ -5955,15 +5967,15 @@ public class StatisticsEsService {
|
|
|
public JSONObject getTotal3Data(ScreenQvo qvo) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
if (qvo.getFlag()==1){
|
|
|
qvo.setStartDate( DateUtil.getFirstMonthDay() +" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay()+" 23:59:59");
|
|
|
} else if (qvo.getFlag()==2) {
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(),-6)+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
}else if (qvo.getFlag()==3){
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime()+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() +" 23:59:59");
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
|
|
|
// 计算上一个周期 开始时间period[0] 、结束时间period[1]
|
|
@ -6077,15 +6089,15 @@ public class StatisticsEsService {
|
|
|
* {"index":5,"startDate":"2023-07-01","endDate":"2023-07-19","area":"350200","level":2,"level2_type":4,"interval":1}
|
|
|
*/
|
|
|
public JSONObject getKindsConsultCount(ScreenQvo qvo) throws Exception {
|
|
|
if (qvo.getFlag()==1){
|
|
|
qvo.setStartDate( DateUtil.getFirstMonthDay() +" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay()+" 23:59:59");
|
|
|
} else if (qvo.getFlag()==2) {
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(),-6)+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
}else if (qvo.getFlag()==3){
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime()+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() +" 23:59:59");
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
|
|
|
//专家咨询数量 = 图文咨询 + 视频咨询
|
|
@ -6110,7 +6122,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
|
|
|
//计算百分比
|
|
|
int total =xtmz+twzx+twfz+spzx+spfz;
|
|
|
int total = xtmz + twzx + twfz + spzx + spfz;
|
|
|
|
|
|
result.put("xtmz", xtmz);//协同门诊
|
|
|
result.put("twzx", twzx);//图文咨询
|
|
@ -6118,11 +6130,11 @@ public class StatisticsEsService {
|
|
|
result.put("spzx", spzx);//视频咨询
|
|
|
result.put("spfz", spfz);//视频复诊
|
|
|
//百分比
|
|
|
result.put("xtmz_bfb", getRange(xtmz,total , 0));//协同门诊
|
|
|
result.put("twzx_bfb", getRange(twzx,total , 0));//图文咨询
|
|
|
result.put("twfz_bfb", getRange(twfz,total , 0));//图文复诊
|
|
|
result.put("spzx_bfb", getRange(spzx,total , 0));//视频咨询
|
|
|
result.put("spfz_bfb", getRange(spfz,total , 0));//视频复诊
|
|
|
result.put("xtmz_bfb", getRange(xtmz, total, 0));//协同门诊
|
|
|
result.put("twzx_bfb", getRange(twzx, total, 0));//图文咨询
|
|
|
result.put("twfz_bfb", getRange(twfz, total, 0));//图文复诊
|
|
|
result.put("spzx_bfb", getRange(spzx, total, 0));//视频咨询
|
|
|
result.put("spfz_bfb", getRange(spfz, total, 0));//视频复诊
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@ -6141,18 +6153,18 @@ public class StatisticsEsService {
|
|
|
*/
|
|
|
public JSONObject getConsultAndPrescriptionList(ScreenQvo qvo) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (qvo.getFlag()==1){
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
//本月
|
|
|
qvo.setStartDate( DateUtil.getFirstMonthDay() +" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay()+" 23:59:59");
|
|
|
} else if (qvo.getFlag()==2) {
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
//近半年
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(),-6)+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
}else if (qvo.getFlag()==3){
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
//全年
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime()+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() +" 23:59:59");
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
@ -6162,7 +6174,7 @@ public class StatisticsEsService {
|
|
|
|
|
|
|
|
|
//按月分组
|
|
|
if ("2".equals(String.valueOf(qvo.getFlag()))|| "3".equals(String.valueOf(qvo.getFlag())) ) {
|
|
|
if ("2".equals(String.valueOf(qvo.getFlag())) || "3".equals(String.valueOf(qvo.getFlag()))) {
|
|
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
String key = entry.getKey();
|
|
|
String value = entry.getValue();
|
|
@ -6186,7 +6198,7 @@ public class StatisticsEsService {
|
|
|
//算出开方量
|
|
|
JSONArray array = monthTotalStatistics2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "2", null, SaveModel.timeLevel_ZL, null);
|
|
|
result.put("prescriptionVolume", array);
|
|
|
}else {
|
|
|
} else {
|
|
|
//按天分组
|
|
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
String key = entry.getKey();
|
|
@ -6221,18 +6233,18 @@ public class StatisticsEsService {
|
|
|
* 诊查费(21) + 处方费(3)
|
|
|
*/
|
|
|
public JSONObject getDrugAndExaminationFeeList(ScreenQvo qvo) throws Exception {
|
|
|
if (qvo.getFlag()==1){
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
//本月
|
|
|
qvo.setStartDate( DateUtil.getFirstMonthDay() +" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay()+" 23:59:59");
|
|
|
} else if (qvo.getFlag()==2) {
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
//近半年
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(),-6)+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
}else if (qvo.getFlag()==3){
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
//全年
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime()+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() +" 23:59:59");
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
JSONObject result = new JSONObject();
|
|
@ -6243,10 +6255,10 @@ public class StatisticsEsService {
|
|
|
String key = entry.getKey();
|
|
|
String value = entry.getValue();
|
|
|
//按月
|
|
|
if ("2".equals(String.valueOf(qvo.getFlag()))|| "3".equals(String.valueOf(qvo.getFlag())) ) {
|
|
|
if ("2".equals(String.valueOf(qvo.getFlag())) || "3".equals(String.valueOf(qvo.getFlag()))) {
|
|
|
JSONArray array = monthTotalStatistics2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), value, null, SaveModel.timeLevel_ZL, null);
|
|
|
result.put(key, array);
|
|
|
}else {
|
|
|
} else {
|
|
|
//按日
|
|
|
JSONArray array = dateTotalStatistics2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), value, null, SaveModel.timeLevel_ZL, null);
|
|
|
result.put(key, addWeekdayToJSONArray(array));
|
|
@ -6272,18 +6284,18 @@ public class StatisticsEsService {
|
|
|
*/
|
|
|
public JSONObject getDeptOrDoctorVolumeList(ScreenQvo qvo) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (qvo.getFlag()==1){
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
//本月
|
|
|
qvo.setStartDate( DateUtil.getFirstMonthDay() +" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay()+" 23:59:59");
|
|
|
} else if (qvo.getFlag()==2) {
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
//近半年
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(),-6)+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
}else if (qvo.getFlag()==3){
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
//全年
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime()+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() +" 23:59:59");
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
//查科室
|
|
|
if ("4".equals(String.valueOf(qvo.getLevel()))) {
|
|
@ -6370,7 +6382,7 @@ public class StatisticsEsService {
|
|
|
* 【全院明细】
|
|
|
* 科室、医生、问诊量、接诊量、未接诊量、接诊率、处方量、检查费、药品费、总收入
|
|
|
* 1、按科室 level 4 lowLevel 5
|
|
|
* 2、按医生 level 4 lowLevel 6
|
|
|
* 2、按医生 level 5 lowLevel 6
|
|
|
* //科室和医生
|
|
|
* 视频咨询:{"startDate":"2023-07-01","endDate":"2023-07-20","area":"350211A1002","level":4,"lowLevel":5,"index":15,"lowCode":17}
|
|
|
* 查找医生: {"startDate":"2023-07-17","endDate":"2023-07-20","area":"1010100","level":5,"lowLevel":6,"index":11,"lowCode":9}
|
|
@ -6378,18 +6390,18 @@ public class StatisticsEsService {
|
|
|
public JSONObject getAllHospitalDetails(ScreenQvo qvo) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
List<Map<String, Object>> resultList = null;
|
|
|
if (qvo.getFlag()==1){
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
//本月
|
|
|
qvo.setStartDate( DateUtil.getFirstMonthDay() +" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay()+" 23:59:59");
|
|
|
} else if (qvo.getFlag()==2) {
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
//近半年
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(),-6)+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
}else if (qvo.getFlag()==3){
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
//全年
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime()+" 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() +" 23:59:59");
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
//查科室
|
|
|
if ("4".equals(String.valueOf(qvo.getLevel()))) {
|
|
@ -6419,7 +6431,35 @@ public class StatisticsEsService {
|
|
|
/**
|
|
|
* 获取全部的科室和医生数据
|
|
|
*/
|
|
|
public List getAllDeptAndDoctorDetails(ScreenQvo qvo) {
|
|
|
public List getAllDeptAndDoctorDetails(ScreenQvo qvo) throws Exception {
|
|
|
if (qvo.getFlag() == 1) {
|
|
|
//本月
|
|
|
qvo.setStartDate(DateUtil.getFirstMonthDay() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getLastMonthDay() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 2) {
|
|
|
//近半年
|
|
|
qvo.setStartDate(DateUtil.getMonthDate(new Date(), -6) + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getStringDateShort() + " 23:59:59");
|
|
|
} else if (qvo.getFlag() == 3) {
|
|
|
//全年
|
|
|
qvo.setStartDate(DateUtil.getCurrentYearStartTime() + " 00:00:00");
|
|
|
qvo.setEndDate(DateUtil.getCurrentYearEndTime() + " 23:59:59");
|
|
|
}
|
|
|
//查出所有科室的,在查科室下面的医生的
|
|
|
JSONObject deptObject = getAllHospitalDetails(qvo);//全部科室
|
|
|
List<Map<String, Object>> deptList = (List<Map<String, Object>>) deptObject.get("list");
|
|
|
LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<>();
|
|
|
for (Map<String, Object> map : deptList) {
|
|
|
//level 5
|
|
|
String deptCode = (String) map.get("deptCode");
|
|
|
qvo.setLevel(5);
|
|
|
qvo.setArea(deptCode);
|
|
|
List<Map<String, Object>> doctorList = (List<Map<String, Object>>) getAllHospitalDetails(qvo).get("list");
|
|
|
linkedHashMap.put(deptCode, doctorList);
|
|
|
}
|
|
|
//导出数据
|
|
|
System.out.println(JSON.toJSONString(deptList));
|
|
|
System.out.println(JSON.toJSONString(linkedHashMap));
|
|
|
|
|
|
return null;
|
|
|
}
|
|
@ -6430,12 +6470,12 @@ public class StatisticsEsService {
|
|
|
*/
|
|
|
private List<Map<String, Object>> mergeListsToList(List<Map<String, Object>> resultList, List<SaveModel> model01, List<SaveModel> model02, List<SaveModel> model03, String type) {
|
|
|
for (Map<String, Object> map : resultList) {
|
|
|
String key ="";
|
|
|
String key = "";
|
|
|
|
|
|
if ("1".equals(type)) {
|
|
|
key= (String) map.get("deptName");
|
|
|
}else {
|
|
|
key= (String) map.get("doctorCode");
|
|
|
key = (String) map.get("deptName");
|
|
|
} else {
|
|
|
key = (String) map.get("doctorCode");
|
|
|
}
|
|
|
|
|
|
//处方费
|
|
@ -6594,6 +6634,9 @@ public class StatisticsEsService {
|
|
|
* 根据字符串时间,算出星期几
|
|
|
*/
|
|
|
public static String getChineseWeekday(String dateString) {
|
|
|
if (dateString.length() > 10) {
|
|
|
dateString = dateString.substring(0, 10);
|
|
|
}
|
|
|
LocalDate date = LocalDate.parse(dateString, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
ZonedDateTime zonedDateTime = date.atStartOfDay(ZoneId.of("Asia/Shanghai"));
|
|
|
DayOfWeek dayOfWeek = zonedDateTime.getDayOfWeek();
|
|
@ -6609,6 +6652,10 @@ public class StatisticsEsService {
|
|
|
* 计算上一个周期。按时间间隔
|
|
|
*/
|
|
|
public static String[] calculatePreviousPeriod(String start, String end) {
|
|
|
if (start.length() > 10) {
|
|
|
start = start.substring(0, 10);
|
|
|
end = end.substring(0, 10);
|
|
|
}
|
|
|
// 将时间字符串转换为LocalDate对象
|
|
|
LocalDate startDate = LocalDate.parse(start, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
LocalDate endDate = LocalDate.parse(end, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
@ -6621,6 +6668,9 @@ public class StatisticsEsService {
|
|
|
String previousStartDate = previousStart.format(DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
String previousEndDate = previousEnd.format(DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
// 返回上一个周期的时间段
|
|
|
previousStartDate += " 00:00:00";
|
|
|
previousEndDate += " 23:59:59";
|
|
|
|
|
|
return new String[]{previousStartDate, previousEndDate};
|
|
|
}
|
|
|
|
|
@ -6628,6 +6678,10 @@ public class StatisticsEsService {
|
|
|
* 计算去年同期时间段
|
|
|
*/
|
|
|
public static String[] calculatePreviousYearPeriod(String start, String end) {
|
|
|
if (start.length() > 10) {
|
|
|
start = start.substring(0, 10);
|
|
|
end = end.substring(0, 10);
|
|
|
}
|
|
|
// 将时间字符串转换为LocalDate对象
|
|
|
LocalDate startDate = LocalDate.parse(start, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
LocalDate endDate = LocalDate.parse(end, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
@ -6637,6 +6691,8 @@ public class StatisticsEsService {
|
|
|
// 将日期对象转换为字符串
|
|
|
String previousStartDate = previousStart.format(DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
String previousEndDate = previousEnd.format(DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
previousStartDate += " 00:00:00";
|
|
|
previousEndDate += " 23:59:59";
|
|
|
// 返回去年同期的时间段
|
|
|
return new String[]{previousStartDate, previousEndDate};
|
|
|
}
|
|
@ -6746,5 +6802,4 @@ public class StatisticsEsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|