|
@ -715,7 +715,7 @@ public class StatisticsESService {
|
|
|
|
|
|
public JSONObject getGroupInfoOnline(String endDate, String lowCode, String area, int level, String year) throws Exception {
|
|
|
List<SaveModel> list = elasticsearchUtil.findDateQuotaLevel1(endDate, endDate, area, level, "17", "2", lowCode, null, null);
|
|
|
List<SaveModel> onlineList = elasticsearchUtil.findDateQuotaLevel1(endDate, endDate, area, level, "17", "2", lowCode, null, null);
|
|
|
List<SaveModel> onlineList = elasticsearchUtil.findDateQuotaLevel1(endDate, endDate, area, level, "73", "2", lowCode, null, null);
|
|
|
long total = 0;
|
|
|
long onlineTotal = 0;
|
|
|
if (list.size() > 0) {
|
|
@ -4516,22 +4516,22 @@ public class StatisticsESService {
|
|
|
String timeKey = elasticsearchUtil.getQuotaTime();
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
String renewIndex = "";//续签指标
|
|
|
if (level==3){//区
|
|
|
if (StringUtils.isNotBlank(lowCode)){
|
|
|
if (Integer.valueOf(low_level)==3){//区
|
|
|
if (StringUtils.isBlank(lowCode)){
|
|
|
renewIndex="44";
|
|
|
}else{
|
|
|
renewIndex="54";
|
|
|
}
|
|
|
}
|
|
|
if (level==4){//社区
|
|
|
if (StringUtils.isNotBlank(lowCode)){
|
|
|
if (Integer.valueOf(low_level)==4){//社区
|
|
|
if (StringUtils.isBlank(lowCode)){
|
|
|
renewIndex="43";
|
|
|
}else{
|
|
|
renewIndex="53";
|
|
|
}
|
|
|
}
|
|
|
if (level==5){//团队
|
|
|
if (StringUtils.isNotBlank(lowCode)){
|
|
|
if (Integer.valueOf(low_level)==5){//团队
|
|
|
if (StringUtils.isBlank(lowCode)){
|
|
|
renewIndex="42";
|
|
|
}else{
|
|
|
renewIndex="52";
|
|
@ -4776,4 +4776,121 @@ public class StatisticsESService {
|
|
|
return new JSONArray();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单统计-点击柱状图获取详情
|
|
|
* @param interval
|
|
|
* @param date
|
|
|
* @param disease
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> getPrescriptionTotalDetailTime(int interval,String date,String disease,String type){
|
|
|
//如果是日就是按一天,周就是从本周一到本周日,月就是本月第一天到本月最后一天
|
|
|
String startTime = "";
|
|
|
String endTime = "";
|
|
|
if (interval==1){
|
|
|
startTime = date+" 00:00:00";
|
|
|
endTime = " 23:59:59";
|
|
|
}else if (interval==2){
|
|
|
startTime = DateUtil.getMondayOfThisDate(DateUtil.strToDate(date));
|
|
|
endTime = DateUtil.getSundayOfThisDate(DateUtil.strToDate(date));
|
|
|
startTime += " 00:00:00";
|
|
|
endTime += "23:59:59";
|
|
|
}else if (interval==3){
|
|
|
startTime = DateUtil.getFristDayOfMonthThisDate(DateUtil.strToDate(date+"-01"));
|
|
|
endTime = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(date+"-01"));
|
|
|
startTime += " 00:00:00";
|
|
|
endTime += " 23:59:59";
|
|
|
}
|
|
|
String sql = "SELECT * FROM wlyy_prescription p ";
|
|
|
if(StringUtils.isNotBlank(disease)){
|
|
|
sql += " JOIN wlyy_prescription_diagnosis d ON d.prescription_code = p.code WHERE d.health_problem ='"+disease+"' ";
|
|
|
}else{
|
|
|
sql +=" WHERE 1=1 ";
|
|
|
}
|
|
|
if ("2".equals(type)){//已完成
|
|
|
sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.finish.getValue() ;
|
|
|
}else if ("3".equals(type)){//居民取消
|
|
|
sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue() ;
|
|
|
}else if ("4".equals(type)){//审核不通过
|
|
|
sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue() ;
|
|
|
}else if ("5".equals(type)){//进行中
|
|
|
sql += " AND p.`status` < " + PrescriptionLog.PrescriptionLogStatus.finish.getValue() +
|
|
|
" AND p.`status`>= " + PrescriptionLog.PrescriptionLogStatus.revieweding.getValue() ;
|
|
|
}else if ("6".equals(type)){//其他原因取消
|
|
|
sql += " AND p.`status` <= "+PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue() ;
|
|
|
}
|
|
|
sql += " AND p.create_time <= ? " +
|
|
|
" AND p.create_time >= ? ";
|
|
|
List<Map<String,Object>> resultList = jdbcTemplate.queryForList(sql,new Object[]{endTime,startTime});
|
|
|
return resultList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 长处方记录筛选
|
|
|
* @param level
|
|
|
* @param area
|
|
|
* @param disease
|
|
|
* @param status
|
|
|
* @param type
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> getPrescriptionByCondition(String keyWord, String level, String area, String disease, String status, String type, String startTime,String endTime){
|
|
|
startTime += " 00:00:00";
|
|
|
endTime += " 23:59:59";
|
|
|
String sql = "SELECT * FROM wlyy_prescription p ";
|
|
|
//判断疾病
|
|
|
if(StringUtils.isNotBlank(disease)){
|
|
|
sql += " JOIN wlyy_prescription_diagnosis d ON d.prescription_code = p.code WHERE d.health_problem ='"+disease+"' ";
|
|
|
}else{
|
|
|
sql +=" WHERE 1=1 ";
|
|
|
}
|
|
|
//判断关键字
|
|
|
if (StringUtils.isNotBlank(keyWord)){
|
|
|
sql += " AND (p.patient_name like '%"+keyWord+"%' or p.doctor_name like '%"+keyWord+"%')";
|
|
|
}
|
|
|
//判断状态
|
|
|
if ("2".equals(status)){//已完成
|
|
|
sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.finish.getValue() ;
|
|
|
}else if ("3".equals(status)){//居民取消
|
|
|
sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue() ;
|
|
|
}else if ("4".equals(status)){//审核不通过
|
|
|
sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue() ;
|
|
|
}else if ("5".equals(status)){//进行中
|
|
|
sql += " AND p.`status` < " + PrescriptionLog.PrescriptionLogStatus.finish.getValue() +
|
|
|
" AND p.`status`>= " + PrescriptionLog.PrescriptionLogStatus.revieweding.getValue() ;
|
|
|
}else if ("6".equals(status)){//其他原因取消
|
|
|
sql += " AND p.`status` <= "+PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue() ;
|
|
|
}
|
|
|
//判断取药方式
|
|
|
if (StringUtils.isNotBlank(type)){
|
|
|
//类型1.自取,2.快递配送,3.健管师配送
|
|
|
if("1".equals(type)){
|
|
|
sql +=" AND p.dispensary_type ="+type;
|
|
|
}else if("2".equals(type)){
|
|
|
sql +=" AND p.dispensary_type ="+type;
|
|
|
}else if("3".equals(type)){
|
|
|
sql +=" AND p.dispensary_type ="+type;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//市区
|
|
|
if("4".equals(level)){
|
|
|
//市区无过滤
|
|
|
//区级
|
|
|
}else if("3".equals(level)){
|
|
|
sql += " AND LEFT(p.hospital, 6) = '"+area+"' ";
|
|
|
//机构
|
|
|
}else if("2".equals(level)){
|
|
|
sql += "AND p.hospital = '"+area+"' ";
|
|
|
}
|
|
|
|
|
|
sql += " AND p.create_time <= ? " +
|
|
|
" AND p.create_time >= ? ";
|
|
|
List<Map<String,Object>> resultList = jdbcTemplate.queryForList(sql,new Object[]{endTime,startTime});
|
|
|
return resultList;
|
|
|
}
|
|
|
}
|