Browse Source

医生菜单,接诊量

suqinyi 1 year ago
parent
commit
8f6b46dfb3

+ 133 - 67
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -15,16 +15,12 @@ import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.es.util.SaveModel;
import com.yihu.jw.evaluate.score.service.BaseEvaluateScoreService;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.restmodel.hospital.statistics.ScreenQvo;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.format.VerticalAlignment;
import jxl.write.*;
import org.apache.commons.lang3.StringUtils;
@ -38,7 +34,6 @@ import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.ParseException;
@ -50,6 +45,7 @@ import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.TextStyle;
import java.util.*;
import java.util.stream.Collectors;
/**
 * Created by wangzhinan on 2019/12/3.
@ -82,6 +78,9 @@ public class StatisticsEsService {
    private String wxId;
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    @Autowired
    private WlyyHospitalSysDictDao sysDictDao;//字典
    /**
     * 问诊量
@ -1015,8 +1014,10 @@ public class StatisticsEsService {
                        return -1;
                    } else if (a == b) {
                        return 0;
                    } else
                    } else {
                        return 1;
                    }
                }
            });
            JSONArray jsonArray = JSONArray.parseArray(bindArrayResult.toString());
@ -5843,25 +5844,25 @@ public class StatisticsEsService {
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> selectArticleCountExcel(Integer flag, String startDate, String endDate,int level, String area, String lowLevel, String lowCode) throws Exception {
        if (level==4){
            List<Map<String,Object>> mapList = getArticleExcel(flag,startDate,endDate,level,area, "5", null);
            for (Map<String,Object> map:mapList){
                List<Map<String,Object>> maps= getArticleExcel(flag,startDate,endDate,5,map.get("code").toString(), "6", null);
                map.put("doctors",maps);
    public List<Map<String, Object>> selectArticleCountExcel(Integer flag, String startDate, String endDate, int level, String area, String lowLevel, String lowCode) throws Exception {
        if (level == 4) {
            List<Map<String, Object>> mapList = getArticleExcel(flag, startDate, endDate, level, area, "5", null);
            for (Map<String, Object> map : mapList) {
                List<Map<String, Object>> maps = getArticleExcel(flag, startDate, endDate, 5, map.get("code").toString(), "6", null);
                map.put("doctors", maps);
            }
            return mapList;
        }
        return null;
    }
    public void pushArticleTotalExcel(OutputStream os, List<Map<String, Object>> list) throws Exception{
    public void pushArticleTotalExcel(OutputStream os, List<Map<String, Object>> list) throws Exception {
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"科室","医生","发布类型","发布量","点赞量","收藏数","评论数"};
            String[] header = {"科室", "医生", "发布类型", "发布量", "点赞量", "收藏数", "评论数"};
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
@ -5873,23 +5874,23 @@ public class StatisticsEsService {
            for (Map<String, Object> m : list) {
                addCell(ws, i, 0, m.get("name")!=null?m.get("name").toString():n);
                addCell(ws, i, 0, m.get("name") != null ? m.get("name").toString() : n);
                addCell(ws, i, 1, "-");
                addCell(ws, i, 2, m.get("publishTypeCount")!=null?m.get("publishTypeCount").toString():n);
                addCell(ws, i, 3, m.get("total")!=null?m.get("total").toString():n);
                addCell(ws, i, 4, m.get("dianzangCount")!=null?m.get("dianzangCount").toString():n);
                addCell(ws, i, 5, m.get("collectCount")!=null?m.get("collectCount").toString():n);
                addCell(ws, i, 6, m.get("pinglunCount")!=null?m.get("pinglunCount").toString():n);
                addCell(ws, i, 2, m.get("publishTypeCount") != null ? m.get("publishTypeCount").toString() : n);
                addCell(ws, i, 3, m.get("total") != null ? m.get("total").toString() : n);
                addCell(ws, i, 4, m.get("dianzangCount") != null ? m.get("dianzangCount").toString() : n);
                addCell(ws, i, 5, m.get("collectCount") != null ? m.get("collectCount").toString() : n);
                addCell(ws, i, 6, m.get("pinglunCount") != null ? m.get("pinglunCount").toString() : n);
                i++;
                List<Map<String,Object>> maps = (List<Map<String, Object>>) m.get("doctors");
                for (Map<String,Object> map:maps){
                    addCell(ws, i, 0, m.get("name")!=null?m.get("name").toString():n);
                    addCell(ws, i, 1, map.get("name")!=null?map.get("name").toString():n);
                    addCell(ws, i, 2, map.get("publishTypeCount")!=null?map.get("publishTypeCount").toString():n);
                    addCell(ws, i, 3, map.get("total")!=null?map.get("total").toString():n);
                    addCell(ws, i, 4, map.get("dianzangCount")!=null?map.get("dianzangCount").toString():n);
                    addCell(ws, i, 5, map.get("collectCount")!=null?map.get("collectCount").toString():n);
                    addCell(ws, i, 6, map.get("pinglunCount")!=null?map.get("pinglunCount").toString():n);
                List<Map<String, Object>> maps = (List<Map<String, Object>>) m.get("doctors");
                for (Map<String, Object> map : maps) {
                    addCell(ws, i, 0, m.get("name") != null ? m.get("name").toString() : n);
                    addCell(ws, i, 1, map.get("name") != null ? map.get("name").toString() : n);
                    addCell(ws, i, 2, map.get("publishTypeCount") != null ? map.get("publishTypeCount").toString() : n);
                    addCell(ws, i, 3, map.get("total") != null ? map.get("total").toString() : n);
                    addCell(ws, i, 4, map.get("dianzangCount") != null ? map.get("dianzangCount").toString() : n);
                    addCell(ws, i, 5, map.get("collectCount") != null ? map.get("collectCount").toString() : n);
                    addCell(ws, i, 6, map.get("pinglunCount") != null ? map.get("pinglunCount").toString() : n);
                    i++;
                }
            }
@ -5962,7 +5963,7 @@ public class StatisticsEsService {
    /**
     *  按照科室和医生查询列表
     * 按照科室和医生查询列表
     *
     * @param flag
     * @param startDate
@ -5974,41 +5975,41 @@ public class StatisticsEsService {
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> getArticleTotalList(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>> getArticleTotalList(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<Map<String,Object>> resultMaps = new ArrayList<>();
        for (SaveModel saveModel:total){
            Map<String,Object> map = new HashMap<>();
        List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1Empty(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL, lowLevel, lowCode);//总数
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (SaveModel saveModel : total) {
            Map<String, Object> map = new HashMap<>();
            if (SaveModel.doctorLevel.equalsIgnoreCase(lowLevel)) {
                map.put("code",saveModel.getDoctor());
                map.put("code", saveModel.getDoctor());
                map.put("name", saveModel.getDoctorName());
                BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(saveModel.getDoctor());
                if (doctorDO!=null){
                    map.put("doctor",doctorDO);
                if (doctorDO != null) {
                    map.put("doctor", doctorDO);
                }
                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());
                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                    map.put("doctorHospital",doctorHospitalDOS);
                if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
                    map.put("doctorHospital", doctorHospitalDOS);
                }
            } else if (SaveModel.deptLevel.equalsIgnoreCase(lowLevel)) {
                map.put("code",saveModel.getDept());
                map.put("code", saveModel.getDept());
                map.put("name", saveModel.getDeptName());
            } else if (SaveModel.OrgLevel.equalsIgnoreCase(lowLevel)) {
                map.put("code",saveModel.getHospital());
                map.put("code", saveModel.getHospital());
                map.put("name", saveModel.getHospitalName());
            }
            map.put("total",saveModel.getResult1().intValue());
            map.put("total", saveModel.getResult1().intValue());
            resultMaps.add(map);
        }
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
@ -6021,7 +6022,6 @@ public class StatisticsEsService {
    }
    /**
     * 文章类型统计
     *
@ -6126,6 +6126,10 @@ public class StatisticsEsService {
        //---------------------【接诊量】------------------------------------
        //接诊量-已接诊
        List<SaveModel> jz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12,14,16", "1", null, "9,16,12,1,17", "1");
        //上个周期
        List<SaveModel> jz_model02 = elasticsearchUtil.findListDateQuotaLevel2(period[0], period[1], qvo.getArea(), qvo.getLevel(), "12,14,16", "1", null, "9,16,12,1,17", "1");
        //去年同期时间
        List<SaveModel> jz_model03 = elasticsearchUtil.findListDateQuotaLevel2(periodYear[0], periodYear[1], qvo.getArea(), qvo.getLevel(), "12,14,16", "1", null, "9,16,12,1,17", "1");
        /**
         *  计算同比和环比
@ -6136,34 +6140,40 @@ public class StatisticsEsService {
        //上周期总收入
        int periodTotal = countListTotal(model03) + countListTotal(model04);
        //去年同期时间段总收入
        int periodYearTotal =countListTotal(model05) + countListTotal(model06);
        int periodYearTotal = countListTotal(model05) + countListTotal(model06);
        //赋值
        result.put("fee_examination",countListTotal(model01));//诊查费
        result.put("fee_examination", countListTotal(model01));//诊查费
        result.put("fee_prescription", countListTotal(model02));//处方费
        result.put("fee_total", totalRevenue);//总收入
        result.put("fee_hb", getRange((totalRevenue - periodTotal), periodTotal, 0));//环比
        result.put("fee_tb",getRange((totalRevenue - periodYearTotal), periodYearTotal, 0));//同比
        result.put("fee_tb", getRange((totalRevenue - periodYearTotal), periodYearTotal, 0));//同比
        int patientVolume = 0;
        //接诊量
        if (!jz_model01.isEmpty()) {
            patientVolume = (int) jz_model01.stream().mapToDouble(SaveModel::getResult1).sum();
        }
        int patientVolume = countListTotal(jz_model01);
        int periodPatientVolume = countListTotal(jz_model02);//上个周期
        int periodYearPatientVolume = countListTotal(jz_model03);//去年同期时间
        result.put("wzl_jz", patientVolume);//接诊量
        result.put("wzl_jz_hb", getRange((patientVolume - periodPatientVolume), periodPatientVolume, 0));//接诊量-环比
        result.put("wzl_jz_tb", getRange((patientVolume - periodYearPatientVolume), periodYearPatientVolume, 0));//接诊量-同比
        //问诊
        int wzl = countListTotal(wz_model01);
        //同比和环比
        int wzl_period = countListTotal(wz_model02);//上个周期
        int wzl_periodYear = countListTotal(wz_model03);//去年同周期
        result.put("wzl_total", wzl);//问诊量
        result.put("wzl_jz", patientVolume);//接诊量
        result.put("wzl_jzl", getRange(patientVolume, wzl, 0));//【接诊率】= 接诊量 ÷ 问诊量 ×100%
        result.put("wzl_hb", getRange((wzl - wzl_period), wzl_period, 0));//环比
        result.put("wzl_tb", getRange((wzl - wzl_periodYear), wzl_periodYear, 0));//同比
        //开方 【处方量】
        int kf_total = countListTotal(cf_model01);
        int kf_period =  countListTotal(cf_model02);;//上个周期
        int kf_periodYear = countListTotal(cf_model03);;//去年同周期
        int kf_period = countListTotal(cf_model02);
        ;//上个周期
        int kf_periodYear = countListTotal(cf_model03);
        ;//去年同周期
        result.put("kf_total", kf_total);//开方量
        result.put("kf_kfl", getRange(kf_total, patientVolume, 0));//【处方率】= 处方量 ÷ 接诊量 ×100%
        result.put("kf_hb", getRange((kf_total - kf_period), kf_period, 0));//环比
@ -6336,7 +6346,7 @@ public class StatisticsEsService {
            qvo.setStartDate(DateUtil.getCurrentYearStartTime());
            qvo.setEndDate(DateUtil.getCurrentYearEndTime());
        }
        System.out.println("赋值时间-参数:"+JSON.toJSONString(qvo));
        System.out.println("赋值时间-参数:" + JSON.toJSONString(qvo));
        HashMap<String, String> map = new HashMap<>();
        JSONObject result = new JSONObject();
        map.put("drugFree", "3"); //诊查费
@ -6351,7 +6361,7 @@ public class StatisticsEsService {
                result.put(key, array);
            } else {
                //按日
                System.out.println("执行dateTotalStatistics2方法==>时间"+qvo.getStartDate()+" -- "+qvo.getEndDate());
                System.out.println("执行dateTotalStatistics2方法==>时间" + qvo.getStartDate() + " -- " + qvo.getEndDate());
                JSONArray array = dateTotalStatistics2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), value, null, SaveModel.timeLevel_ZL, null);
                result.put(key, addWeekdayToJSONArray(array));
            }
@ -6470,7 +6480,6 @@ public class StatisticsEsService {
    }
    /**
     * 【全院明细】
     * 科室、医生、问诊量、接诊量、未接诊量、接诊率、处方量、检查费、药品费、总收入
@ -6954,4 +6963,61 @@ public class StatisticsEsService {
    }
    /**
     * todo 查看科室排班数据
     *
     * @param qvo
     * @return
     */
    public JSONObject getDeptScheduling(ScreenQvo qvo) {
        return null;
    }
    /**
     * 获取功能全部的设置
     */
    public JSONObject getAllFunctionSetting() {
        JSONObject result = new JSONObject();
        String sql = " SELECT dict_code \"functionCode\",dict_value \"functionName\" FROM wlyy_hospital_sys_dict WHERE dict_name='FUNCTION_SETTING' ORDER BY sort  ";
        List<Map<String, Object>> functionList = jdbcTemplate.queryForList(sql);
        result.put("list", functionList);
        return result;
    }
    public JSONObject getDoctorSetting(String doctorCode) {
        //设置
        String functionSql = " SELECT dict_code \"functionCode\",dict_value \"functionName\" FROM wlyy_hospital_sys_dict WHERE dict_name='FUNCTION_SETTING' ORDER BY sort  ";
        List<Map<String, Object>> functionList = jdbcTemplate.queryForList(functionSql);
        //医生信息
        String sql = " SELECT function_setting \"functionCode\" FROM base.base_doctor WHERE id='"+doctorCode+"'";
        List<Map<String, Object>> doctorList = jdbcTemplate.queryForList(sql);
        if (doctorList.isEmpty()){
            return null;
        }else {
            String functionCodeList =(String) doctorList.get(0).get("functionCode");
//            List<String> list = Arrays.asList(functionCodeList.split(","));
//            List<Map<String, Object>> collect = functionList.stream()
//                    .filter(map -> map.keySet().containsAll(list))
//                    .collect(Collectors.toList());
            List<Map<String, Object>> list = new ArrayList<>();
            for (String code : functionCodeList.split(",")) {
                for (Map<String, Object> map : functionList) {
                    if (code.equals(map.get("functionCode"))){
                        list.add(map);
                    }
                }
            }
            JSONObject result = new JSONObject();
            result.put("list",list);
            return result;
        }
    }
    public int updateDoctorSetting(String doctorCode,String functionCodeList) {
        String sql=" UPDATE base.base_doctor SET function_setting='"+functionCodeList+"'  WHERE id='"+doctorCode+"'" ;
        int update = jdbcTemplate.update(sql);
        return update;
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -310,6 +310,16 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    private String identity;//身份1是总经理,0是员工
    private String functionSetting;//功能设置
    public String getFunctionSetting() {
        return functionSetting;
    }
    public void setFunctionSetting(String functionSetting) {
        this.functionSetting = functionSetting;
    }
    public String getIdentity() {
        return identity;
    }

+ 4 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1457,6 +1457,10 @@ public class BaseHospitalRequestMapping {
        public static final String getDeptOrDoctorVolumeList = "/getDeptOrDoctorVolumeList";
        public static final String getAllHospitalDetails = "/getAllHospitalDetails";
        public static final String exportHospitalDetails = "/exportHospitalDetails";
        public static final String getDeptScheduling = "/getDeptScheduling";
        public static final String getAllFunctionSetting = "/getAllFunctionSetting";
        public static final String getDoctorSetting = "/getDoctorSetting";
        public static final String updateDoctorSetting = "/updateDoctorSetting";
        public static final String total = "/total";
        public static final String outPatientLine="/outPatientLine";

+ 85 - 14
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -7,16 +7,12 @@ import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.restmodel.hospital.statistics.ScreenQvo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WriteException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,6 +41,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private StatisticsEsService statisticsEsService;
    /**
     * @param startDate
     * @param endDate
@ -1117,7 +1114,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            HttpServletResponse response) {
        try {
            List<Map<String, Object>> list = statisticsEsService.selectArticleCountExcel(flag,startDate,endDate,level,area,lowLevel,lowCode);
            List<Map<String, Object>> list = statisticsEsService.selectArticleCountExcel(flag, startDate, endDate, level, area, lowLevel, lowCode);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("pushArticleTotalExcel.xls"));
            OutputStream os = response.getOutputStream();
@ -1197,7 +1194,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            result = statisticsEsService.getTotal3Data(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getTotal3Data):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(getTotal3Data):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
@ -1215,7 +1212,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            result = statisticsEsService.getKindsConsultCount(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getKindsConsultCount):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(getKindsConsultCount):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
@ -1237,7 +1234,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            result = statisticsEsService.getConsultAndPrescriptionList(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getConsultAndPrescriptionList):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(getConsultAndPrescriptionList):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
@ -1249,7 +1246,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * 参数:
     * timeType=1 按天分组
     * timeType=3 按月分组
     * strJson={"startDate":"2023-07-15","endDate":"2023-07-16","area":"350200","level":2,"flag":"1"}
     * strJson={"startDate":"2023-07-15","endDate":"2023-07-16","area":"350200","level":2,"flag":1}
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.getDrugAndExaminationFeeList)
    @ApiOperation(value = "获取【药品费、诊查费】数据")
@ -1260,7 +1257,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            result = statisticsEsService.getDrugAndExaminationFeeList(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getDrugAndExaminationFeeList):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(getDrugAndExaminationFeeList):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
@ -1280,7 +1277,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            result = statisticsEsService.getDeptOrDoctorVolumeList(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getDeptOrDoctorVolumeList):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(getDeptOrDoctorVolumeList):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
@ -1302,7 +1299,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            result = statisticsEsService.getAllHospitalDetails(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getAllHospitalDetails):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(getAllHospitalDetails):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
@ -1319,12 +1316,86 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("hospitalDetails.xls"));
            OutputStream os = response.getOutputStream();
            statisticsEsService.getAllDeptAndDoctorDetails(qvo,os); //导出
            statisticsEsService.getAllDeptAndDoctorDetails(qvo, os); //导出
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(exportHospitalDetails):报错==>入参:"+JSON.toJSONString(qvo));
            System.out.println("接口(exportHospitalDetails):报错==>入参:" + JSON.toJSONString(qvo));
        }
    }
    /**
     * 查看科室排班数据
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.getDeptScheduling)
    @ApiOperation(value = "查看科室排班数据")
    public ObjEnvelop getDeptScheduling(@RequestParam(required = true) String strJson, HttpServletResponse response) {
        JSONObject result = new JSONObject();
        ScreenQvo qvo = JSON.parseObject(strJson, ScreenQvo.class);
        try {
            result = statisticsEsService.getDeptScheduling(qvo);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getDeptScheduling):报错==>入参:" + JSON.toJSONString(qvo));
        }
        return success(result);
    }
    /**
     * 获取功能全部的设置
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.getAllFunctionSetting)
    @ApiOperation(value = "获取功能全部的设置")
    public ObjEnvelop getAllFunctionSetting() {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getAllFunctionSetting();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getAllFunctionSetting):报错" );
        }
        return success(result);
    }
    /**
     * 获取医生常用设置
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.getDoctorSetting)
    @ApiOperation(value = "获取医生常用设置")
    public Envelop getDoctorSetting(
            @ApiParam(name = "doctorCode", value = "医生code", required = true) @RequestParam(value = "doctorCode", required = false) String doctorCode) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getDoctorSetting(doctorCode);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(getDoctorSetting):报错==>入参:" + JSON.toJSONString(doctorCode));
        }
        return success(result);
    }
    /**
     * 修改医生的常用设置
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.updateDoctorSetting)
    @ApiOperation(value = "修改医生的常用设置")
    public Envelop updateDoctorSetting(
            @ApiParam(name = "doctorCode", value = "医生code", required = true) @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(name = "functionCodeList", value = "菜单id", required = true) @RequestParam(value = "functionCodeList", required = false) String functionCodeList) {
        JSONObject result = new JSONObject();
        try {
            int i = statisticsEsService.updateDoctorSetting(doctorCode, functionCodeList);
            if (i == 1) {
                return success("更新成功");
            } else {
                return success("更新失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("接口(updateDoctorSetting):报错==>入参:" + doctorCode + "----" + functionCodeList);
        }
        return null;
    }
}