소스 검색

Merge branch '2.0' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into 2.0

wangzhinan 11 달 전
부모
커밋
5e67a7efaa
18개의 변경된 파일455개의 추가작업 그리고 232개의 파일을 삭제
  1. 15 1
      business/base-service/src/main/java/com/yihu/jw/article/service/BaseMenuManageService.java
  2. 45 30
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 115 146
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  4. 3 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  5. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java
  6. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/menu/BaseMenuNoLoginEndpoint.java
  7. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/BaseMenuNoLoginEndpoint.java
  8. 2 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  9. 6 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  10. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  11. 24 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  12. 1 1
      svr/svr-statistics-hlw/src/main/java/com/yihu/jw/statistics/job/business/MysqlToEsQuotaJob.java
  13. 5 3
      svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/StatisticsController.java
  14. 212 34
      svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/service/StatisticsService.java
  15. 4 4
      svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/service/FollowUpService.java
  16. 2 1
      svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/controller/ChronicDiseaseController.java
  17. 5 1
      svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/scheme/DoctorSchemeService.java
  18. 7 2
      svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationManageService.java

+ 15 - 1
business/base-service/src/main/java/com/yihu/jw/article/service/BaseMenuManageService.java

@ -783,7 +783,7 @@ public class BaseMenuManageService {
        return list;
    }
    public MixEnvelop findArticleByMenuId(String menuId, String title, Integer page, Integer pageSize, String isContent, String articleType) {
    public MixEnvelop findArticleByMenuId(String categoryFirst,String menuId, String title, Integer page, Integer pageSize, String isContent, String articleType) {
        List<String> menuIds = new ArrayList<>();
        if (StringUtils.isNoneBlank(menuId)) {
            String str[] = menuId.split(",");
@ -805,6 +805,20 @@ public class BaseMenuManageService {
                menuId = menuId.substring(1, menuId.length() - 1);
            }
        }
        if (StringUtils.isNotBlank(categoryFirst)) {
            if (StringUtils.isBlank(menuId)) {
                menuId = "";
            }
            String sqlType = "select * from base_menu_dict where parent_id='" + categoryFirst + "' and is_del='1' and status=1";
            List<BaseMenuDictDO> menuDictDOS = jdbcTemplate.query(sqlType, new BeanPropertyRowMapper<>(BaseMenuDictDO.class));
            if (menuDictDOS.size() > 0) {
                for (BaseMenuDictDO menuDictDO : menuDictDOS) {
                    menuIds.add(menuDictDO.getId());
                    menuId = menuId + "," + menuDictDO.getId() + ",";
                }
                menuId = menuId.substring(1, menuId.length() - 1);
            }
        }
        System.out.print("menuId" + menuId);
        Integer count;

+ 45 - 30
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -597,11 +597,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (StringUtils.isNotBlank(endTime)) {
            totalSql += " AND o.create_time <=:endTime ";
            totalParams.put("endTime", DateUtil.strToDateLong(endTime + " 23:59:59"));
        }
        if (StringUtils.isNotBlank(outpatientType)){
            totalSql+=" AND o.outpatient_type = :outpatientType ";
            totalParams.put("outpatientType", outpatientType);
            if("35".equals(outpatientType)){
                totalSql+=" AND o.outpatient_type in ('3','5') ";
            }else {
                totalSql+=" AND o.outpatient_type = :outpatientType ";
                totalParams.put("outpatientType", outpatientType);
            }
        }
       /* totalParams.add(patient);
        if(status!=null){
@ -706,7 +709,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
        }
        if (StringUtils.isNotBlank(outpatientType)){
            sql+=" AND o.outpatient_type = '"+outpatientType+"' ORDER BY o.create_time DESC ";
            if("35".equals(outpatientType)){
                sql+=" AND o.outpatient_type in ('3','5') ORDER BY o.create_time DESC ";
            }else {
                sql+=" AND o.outpatient_type = '"+outpatientType+"' ORDER BY o.create_time DESC ";
            }
        }
        logger.info("sql="+sql);
@ -4900,28 +4907,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    //1、满意度:使用100分制,取值与医生端首页—我的评价功能内“总评分”的取值相同;
    //2、积分:获得的积分总和-已过期的积分-已兑换的积分;
    //3、个人结算:该医生通过图文复诊、视频复诊收取到的诊查费总和 加上药品费用。
    // 新增 康复咨询待回复和进行中的数量
    public com.alibaba.fastjson.JSONObject doctorIndexStatis(String doctor){
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
//        WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findOneByDictNameAndDictCode("HOSPITAL_INTEGRATE_VALIDITY_DICT","HOSPITAL_INTEGRATE_VALIDITY_DICT");
//        com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(dictDO.getDictValue());
//        //[{"type":0,"flag":0,"dateTime":"2023-07-06T16:00:00.000Z","days":"","description":"<p>1111</p>"},
//        //{"type":1,"flag":1,"dateTime":"","days":"2","description":"<p>5555</p>"}]
//        int flag = 0;
//        String dateTime = "";
//        String days = "";
//        for (int i=0;i<jsonArray.size();i++){
//            com.alibaba.fastjson.JSONObject jsonObject = jsonArray.getJSONObject(i);
//            if(jsonObject.get("type") instanceof Integer && jsonObject.getInteger("type")==1){
//                flag = jsonObject.getInteger("flag");
//                dateTime = jsonObject.getString("dateTime");
//                days = jsonObject.getString("days");
//            }
//        }
//        if(StringUtils.isNotBlank(dateTime)){
//            dateTime = dateTime.substring(0,19);
//            dateTime = dateTime.replaceAll("T"," ");
//        }
        //医生获取积分数据
        String integrateSql ="SELECT\n" +
                "\tIFNULL(SUM(integrate), 0) AS \"total\"\n" +
@ -4929,11 +4917,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "\tbase_hospital_user_integrate\n" +
                "WHERE\n" +
                "\tuser = '"+doctor+"' and status=1 ";
//        if(flag==0){
//            integrateSql += " and create_time>'"+dateTime+"' ";
//        }else {
//            integrateSql += " and (integrate_type=2 or (integrate_type=1 and DATEDIFF(NOW(),create_time)<'"+days+"')) ";
//        }
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(integrateSql);
        Double integrateTotal = 0.0;
        if (rstotal != null && rstotal.size() > 0) {
@ -4967,6 +4950,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "where doctor='"+doctor+"' and `status`>30 ";
        Double fee = jdbcTemplate.queryForObject(sql3,Double.class);
        json.put("fee", fee);
        //新增 康复咨询待回复和进行中的数量
        String sql4 = "SELECT " +
                "count(outpatient.id) AS \"total\" " +
                "FROM " +
                "wlyy_outpatient outpatient," +
                "base_patient patient " +
                "WHERE " +
                "outpatient.patient=patient.id " +
                "AND outpatient.status=1 " +
                "AND outpatient.doctor='" + doctor + "' " +
                "AND outpatient.pay_status = 1 " +
                "AND outpatient.outpatient_type= '4'  ";
        int kfWaitNum = jdbcTemplate.queryForObject(sql4,Integer.class);
        String sql5 = "SELECT COUNT(DISTINCT room.id) AS \"total\" " +
                "FROM  " +
                " wlyy_hospital_waiting_room room, " +
                " base_patient patient,\n" +
                " wlyy_outpatient outpatient \n" +
                " WHERE \n" +
                " room.patient_id=patient.id \n" +
                " AND room.outpatient_id=outpatient.id \n" +
                " AND outpatient.pay_status = 1 \n" +
                " AND outpatient.status = 0 AND outpatient.outpatient_type= '4' AND room.doctor='"+doctor+"' ";
        int kfIngNum = jdbcTemplate.queryForObject(sql5,Integer.class);
        json.put("kfWaitNum", kfWaitNum);//待回复
        json.put("kfIngNum", kfIngNum);//进行中
        return json;
    }
@ -7293,7 +7303,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public MixEnvelop findDoctorByHospitalAndDiseaseAndDept2(String iswork, String patientid, String orgCode, String dept,
                                                            String diseaseKey, String doctorNameKey,
                                                            String jobTitleNameKey, String outpatientType,
                                                            String keyName, String workingTime, String consultStatus, String chargType, String consutlSort, String isAttention, Integer page, Integer pagesize) {
                                                            String keyName, String workingTime, String consultStatus, String chargType, String consutlSort,
                                                             String isAttention,String isNurse, Integer page, Integer pagesize) {
        long statr = new Date().getTime();
        String sql = "SELECT " +
                " d.id AS \"id\", " +
@ -7318,6 +7329,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        sql+=" FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " JOIN dict_job_title jt ON jt.code = d.job_title_code " +
                " Left join ( select count(id) as total,doctor from wlyy_outpatient where status = 3 GROUP BY doctor ) a on a.doctor = d.id ";
        Map<String, Object> params = new HashedMap();
        Date date = new Date();
@ -7415,7 +7427,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                sql += " AND h.dept_code =:dept ";
                params.put("dept", dept);
            }
        }
        if ("1".equals(isNurse)) {
            sql += " AND jt.saas_id = 'hlys' ";
        }
        if (StringUtils.isNotBlank(jobTitleNameKey)) {

+ 115 - 146
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -247,11 +247,11 @@ public class StatisticsEsService {
            //协同门诊
            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, "5", 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> twzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL, "1", null, level2_type);
            List<SaveModel> twzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "5", SaveModel.timeLevel_ZL, "1", null, level2_type);
            ///视频咨询
            List<SaveModel> spzxSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL, "17", null, level2_type);
@ -287,55 +287,7 @@ public class StatisticsEsService {
                Double vedioZJ = 0.0;
                if (index.equalsIgnoreCase("3")) {
                    specialist = 0.0;
                }/*else if (index.equalsIgnoreCase("5")){
                    for (SaveModel saveModel:specialistSaveModels){
                        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("specialist",saveModel.getResult1());
                                specialist = 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("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
                        }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){
                                        BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                                        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());
                                }
                                jsonObject.put("doctorCode",code);
                                BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
                                if (doctorDO!=null){
                                    jsonObject.put("doctorJob",doctorDO.getJobTitleName());
                                }else {
                                    jsonObject.put("doctorJob",null);
                                }
                                jsonObject.put("doctorName",saveModel.getDoctorName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
                        }
                    }
                }*/
                }
                for (SaveModel saveModel : syngySaveModels) {
                    if (level2_type.equals(SaveModel.OrgLevel)) {
@ -677,60 +629,7 @@ public class StatisticsEsService {
                    specialist = 0.0;
                    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())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getHospitalName());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = 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("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
                        }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){
                                        BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                                        jsonObject.put("code",doctorHospitalDO.getDeptCode());
                                        jsonObject.put("name",doctorHospitalDO.getDeptName());
                                    }
                                }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("doctorCode",code);
                                BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(code);
                                if (doctorDO!=null){
                                    jsonObject.put("doctorJob",doctorDO.getJobTitleName());
                                }else {
                                    jsonObject.put("doctorJob",null);
                                }
                                jsonObject.put("doctorName",saveModel.getDoctorName());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
                        }
                    }*/
                }
                for (SaveModel saveModel : syngySaveModels) {
@ -5684,6 +5583,80 @@ public class StatisticsEsService {
        }
    }
    /**
     * 医生圈app-管理员文章统计头部
     *
     * @param flag      0自定义 1本月2近半年3本年
     * @param startDate 开始时间
     * @param endDate   结束时间
     * @param area      区域编码 如 level2 area传市编码
     * @param level     2 市  3区  4医院 5、科室 6医生
     * @return
     * @throws Exception
     */
    public JSONObject getArticleTotalManage(Integer flag, String startDate, String endDate, String area, int level,String slaveKey1) throws Exception {
        //发布量
        SaveModel saveModel = null;
        SaveModel saveModelT = null;
        SaveModel saveModelH = null;
        //收藏量
        SaveModel saveModel3 = null;
        SaveModel saveModel3T = null;
        SaveModel saveModel3H = null;
        //浏览量
        SaveModel saveModel2 = null;
        SaveModel saveModel2T = null;
        SaveModel saveModel2H = 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";
        }
        // 计算上一个周期  开始时间period[0] 、结束时间period[1]
        String[] period = calculatePreviousPeriod(startDate, endDate);
        //计算去年同期时间段 开始时间periodYear[0] 、结束时间periodYear[1]
        String[] periodYear = calculatePreviousYearPeriod(startDate, endDate);
        JSONObject object = new JSONObject();
        //发布量统计
        saveModel = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "75", SaveModel.timeLevel_ZL,slaveKey1);
        saveModelH = elasticsearchUtil.findOneDateQuotaLevel1(period[0], period[1], area, level, "75", SaveModel.timeLevel_ZL,slaveKey1);
        saveModelT = elasticsearchUtil.findOneDateQuotaLevel1(periodYear[0], periodYear[1], area, level, "75", SaveModel.timeLevel_ZL,slaveKey1);
        Integer publishTotal = saveModel != null ? saveModel.getResult1().intValue() : 0;
        Integer publishTotalT = saveModelT != null ? saveModelT.getResult1().intValue() : 0;
        Integer publishTotalH = saveModelH != null ? saveModelH.getResult1().intValue() : 0;
        object.put("publishTotal", publishTotal);//发布量
        object.put("publishTotalT", getTwoRange(publishTotal-publishTotalT,publishTotalT,0));//发布量同比
        object.put("publishTotalH", getTwoRange(publishTotal-publishTotalH,publishTotalH,0));//发布量环比
        //收藏量统计
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(startDate, endDate, area, level, "76", SaveModel.timeLevel_ZL, slaveKey1, "3");
        saveModel3H = elasticsearchUtil.findOneDateQuotaLevel2(period[0], period[1], area, level, "76", SaveModel.timeLevel_ZL, slaveKey1, "3");
        saveModel3T = elasticsearchUtil.findOneDateQuotaLevel2(periodYear[0], periodYear[1], area, level, "76", SaveModel.timeLevel_ZL, slaveKey1, "3");
        Integer collectTotal = saveModel3 != null ? saveModel3.getResult1().intValue() : 0;
        Integer collectTotalT = saveModel3T != null ? saveModel3T.getResult1().intValue() : 0;
        Integer collectTotalH = saveModel3H != null ? saveModel3H.getResult1().intValue() : 0;
        object.put("collectTotal", collectTotal);//收藏量
        object.put("collectTotalT", getTwoRange(collectTotal-collectTotalT,collectTotalT,0));//收藏量同比
        object.put("collectTotalH", getTwoRange(collectTotal-collectTotalH,collectTotalH,0));//收藏量环比
        //浏览量统计
        saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, "77", SaveModel.timeLevel_ZL,slaveKey1);
        saveModel2H = elasticsearchUtil.findOneDateQuotaLevel1(period[0], period[1], area, level, "77", SaveModel.timeLevel_ZL,slaveKey1);
        saveModel2T = elasticsearchUtil.findOneDateQuotaLevel1(periodYear[0], periodYear[1], area, level, "77", SaveModel.timeLevel_ZL,slaveKey1);
        Integer goodTotal = saveModel2 != null ? saveModel2.getResult1().intValue() : 0;
        Integer goodTotalT = saveModel2T != null ? saveModel2T.getResult1().intValue() : 0;
        Integer goodTotalH = saveModel2H != null ? saveModel2H.getResult1().intValue() : 0;
        object.put("goodTotal", goodTotal);//浏览量
        object.put("goodTotalT", getTwoRange(goodTotal-goodTotalT,goodTotalT,0));//浏览量同比
        object.put("goodTotalH", getTwoRange(goodTotal-goodTotalH,goodTotalH,0));//浏览量环比
        return object;
    }
    /**
     * 医生圈app-文章统计头部
     *
@ -6511,23 +6484,23 @@ public class StatisticsEsService {
        //查科室
        if ("4".equals(String.valueOf(qvo.getLevel()))) {
            //问诊总数
            List<SaveModel> model01 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "5", "9");
            List<SaveModel> model02 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "5", "16");
            List<SaveModel> model03 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "5", "12");
            List<SaveModel> model04 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "5", "1");
            List<SaveModel> model05 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "5", "17");
            List<SaveModel> model01 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "9");
            List<SaveModel> model02 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "16");
            List<SaveModel> model03 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "12");
            List<SaveModel> model04 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "1");
            List<SaveModel> model05 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "17");
            //已接诊
            List<SaveModel> jz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "5", "9", "1");
            List<SaveModel> jz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "5", "16", "1");
            List<SaveModel> jz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "5", "12", "1");
            List<SaveModel> jz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "5", "1", "1");
            List<SaveModel> jz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "5", "17", "1");
            List<SaveModel> jz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "9", "1");
            List<SaveModel> jz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "16", "1");
            List<SaveModel> jz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "12", "1");
            List<SaveModel> jz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "1", "1");
            List<SaveModel> jz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "17", "1");
            //未接诊
            List<SaveModel> wjz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "5", "9", "0");
            List<SaveModel> wjz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "5", "16", "0");
            List<SaveModel> wjz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "5", "12", "0");
            List<SaveModel> wjz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "5", "1", "0");
            List<SaveModel> wjz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "5", "17", "0");
            List<SaveModel> wjz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "9", "0");
            List<SaveModel> wjz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "16", "0");
            List<SaveModel> wjz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "12", "0");
            List<SaveModel> wjz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "1", "0");
            List<SaveModel> wjz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "5", "17", "0");
            //转换
            List<Map<String, Object>> list01 = getCoutListPCNew(4, "5", model01, jz_model01, wjz_model01);
@ -6563,23 +6536,23 @@ public class StatisticsEsService {
        //查医生
        if ("5".equals(String.valueOf(qvo.getLevel()))) {
            //问诊总数
            List<SaveModel> model01 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "6", "9");
            List<SaveModel> model02 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "6", "16");
            List<SaveModel> model03 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "6", "12");
            List<SaveModel> model04 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "6", "1");
            List<SaveModel> model05 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "6", "17");
            List<SaveModel> model01 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "9");
            List<SaveModel> model02 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "16");
            List<SaveModel> model03 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "12");
            List<SaveModel> model04 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "1");
            List<SaveModel> model05 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "17");
            //已接诊
            List<SaveModel> jz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "6", "9", "1");
            List<SaveModel> jz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "6", "16", "1");
            List<SaveModel> jz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "6", "12", "1");
            List<SaveModel> jz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "6", "1", "1");
            List<SaveModel> jz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "6", "17", "1");
            List<SaveModel> jz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "9", "1");
            List<SaveModel> jz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "16", "1");
            List<SaveModel> jz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "12", "1");
            List<SaveModel> jz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "1", "1");
            List<SaveModel> jz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "17", "1");
            //未接诊
            List<SaveModel> wjz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "6", "9", "0");
            List<SaveModel> wjz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "6", "16", "0");
            List<SaveModel> wjz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "6", "12", "0");
            List<SaveModel> wjz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "6", "1", "0");
            List<SaveModel> wjz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "6", "17", "0");
            List<SaveModel> wjz_model01 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "9", "0");
            List<SaveModel> wjz_model02 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "16", "0");
            List<SaveModel> wjz_model03 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "12", "0");
            List<SaveModel> wjz_model04 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "1", "0");
            List<SaveModel> wjz_model05 = elasticsearchUtil.findListDateQuotaLevel2(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, "6", "17", "0");
            List<Map<String, Object>> list01 = getCoutListPCNew(5, "6", model01, jz_model01, wjz_model01);
            List<Map<String, Object>> list02 = getCoutListPCNew(5, "6", model02, jz_model02, wjz_model02);
@ -6734,11 +6707,11 @@ public class StatisticsEsService {
        //---------------------【处方量】------------------------------------
        List<SaveModel> cf_model01 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "2", SaveModel.timeLevel_ZL, null, null);//开方量
        List<SaveModel> cf_model01 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "20", SaveModel.timeLevel_ZL, null, null);//开方量
        //上个周期
        List<SaveModel> cf_model02 = elasticsearchUtil.findListDateQuotaLevel1(period[0], period[1], qvo.getArea(), qvo.getLevel(), "2", SaveModel.timeLevel_ZL, null, null);//开方量
        List<SaveModel> cf_model02 = elasticsearchUtil.findListDateQuotaLevel1(period[0], period[1], qvo.getArea(), qvo.getLevel(), "20", SaveModel.timeLevel_ZL, null, null);//开方量
        //去年同期时间
        List<SaveModel> cf_model03 = elasticsearchUtil.findListDateQuotaLevel1(periodYear[0], periodYear[1], qvo.getArea(), qvo.getLevel(), "2", SaveModel.timeLevel_ZL, null, null);//开方量
        List<SaveModel> cf_model03 = elasticsearchUtil.findListDateQuotaLevel1(periodYear[0], periodYear[1], qvo.getArea(), qvo.getLevel(), "20", SaveModel.timeLevel_ZL, null, null);//开方量
        //---------------------【接诊量】------------------------------------
        //接诊量-已接诊
@ -8183,6 +8156,7 @@ public class StatisticsEsService {
                "FROM\n" +
                "	base_doctor a\n" +
                "	INNER JOIN base_doctor_hospital b ON a.id = b.doctor_code \n" +
                "	INNER JOIN dict_hospital_dept dhd ON dhd.code = b.DEPT_CODE and dhd.CONSULT_DEPT_FLAG='1' " +
                "WHERE\n" +
                "	1 = 1 \n" +
                "	AND a.del='1' AND b.del='1'\n" +
@ -8190,15 +8164,10 @@ public class StatisticsEsService {
                "	AND a.outpatient_type <> '' \n" +
                "	AND b.dept_code IS NOT NULL ";
        String doctorSql = "SELECT\n" +
                "	count( DISTINCT a.id ) \n" +
                "FROM\n" +
                "	base_doctor a \n" +
                "WHERE\n" +
                "	1 = 1 \n" +
                "	AND a.del = '1' \n" +
                "	AND a.outpatient_type IS NOT NULL \n" +
                "	AND a.outpatient_type <> ''";
        String doctorSql = "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'  ";
        CompletableFuture<Integer> future01 = CompletableFuture.supplyAsync(() -> {
            Integer integer = jdbcTemplate.queryForObject(deptSql, Integer.class);

+ 3 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4324,7 +4324,9 @@ public class ImService {
                sql += " AND op.outpatient_type = 4";
            } else if (type.equalsIgnoreCase("29")) {
                sql += " AND op.outpatient_type = 1 and  oh.id is not null ";
            } else {
            } else if (type.equalsIgnoreCase("30")) {
                sql += " AND op.outpatient_type = 5";
            }  else {
                sql += " AND op.type in (1,2,3) ";
            }
        }

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java

@ -50,7 +50,7 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    private String conNo;
    /**
     * 1.在线复诊2.协同门诊 3.专家咨询 4为上门复诊
     * 1.在线复诊2.协同门诊 3.专家咨询 4康复咨询 5.护理咨询
     */
    private String outpatientType;
    /**

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/menu/BaseMenuNoLoginEndpoint.java

@ -61,7 +61,9 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.MenuNologin.findArticleByMenuId)
    @ApiOperation(value = "查询文章")
    public Envelop findArticleByMenuid(
            @ApiParam(name = "menuId", value = "menuId", required = false)
            @ApiParam(name = "categoryFirst", value = "一级分类", required = false)
            @RequestParam(value = "categoryFirst",required = false) String categoryFirst,
            @ApiParam(name = "menuId", value = "二级分类", required = false)
            @RequestParam(value = "menuId",required = false) String menuId,
            @ApiParam(name = "title", value = "menuId", required = false)
            @RequestParam(value = "title",required = false) String title,
@ -74,7 +76,7 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize", value = "pageSize", required = false)
            @RequestParam(value = "pageSize",required = true) Integer pageSize) {
        try {
            return success(menuService.findArticleByMenuId(menuId,title,page,pageSize,isContent,articleType));
            return success(menuService.findArticleByMenuId(categoryFirst,menuId,title,page,pageSize,isContent,articleType));
        }catch (Exception e){
            return failedException(e);
        }

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/BaseMenuNoLoginEndpoint.java

@ -63,6 +63,8 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.MenuNologin.findArticleByMenuId)
    @ApiOperation(value = "查询文章")
    public Envelop findArticleByMenuid(
            @ApiParam(name = "categoryFirst", value = "一级分类", required = false)
            @RequestParam(value = "categoryFirst",required = false) String categoryFirst,
            @ApiParam(name = "menuId", value = "menuId", required = false)
            @RequestParam(value = "menuId",required = false) String menuId,
            @ApiParam(name = "articleType", value = "文章类型", required = false)
@ -74,7 +76,7 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize", value = "pageSize", required = false)
            @RequestParam(value = "pageSize",required = true) Integer pageSize) {
        try {
            return success(menuService.findArticleByMenuId(menuId,title,page,pageSize,"0",articleType));
            return success(menuService.findArticleByMenuId(categoryFirst,menuId,title,page,pageSize,"0",articleType));
        }catch (Exception e){
            return failedException(e);
        }

+ 2 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -378,6 +378,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "chargType", value = "医生号别") @RequestParam(value = "chargType", required = false, defaultValue = "") String chargType,
            @ApiParam(name = "consutlSort", value = "咨询量排序") @RequestParam(value = "consutlSort", required = true, defaultValue = "DESC") String consutlSort,
            @ApiParam(name = "isAttention", value = "是否关注") @RequestParam(value = "isAttention", required = false) String isAttention,
            @ApiParam(name = "isNurse", value = "是否护师 1:是 0:否 不传:查所有") @RequestParam(value = "isNurse", required = false)String isNurse,
            @ApiParam(name = "page", value = "第几页") @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "pagesize", value = "分页大小") @RequestParam(value = "pagesize", required = false) Integer pagesize
    ) throws Exception {
@ -387,7 +388,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
                    orgCode, dept,
                    diseaseKey, doctorNameKey,
                    jobTitleNameKey, outpatientType,
                    keyName, workingTime, consultStatus, chargType, consutlSort, isAttention, page, pagesize);
                    keyName, workingTime, consultStatus, chargType, consutlSort, isAttention,isNurse, page, pagesize);
        } catch (Exception e) {
            return failedMixEnvelopException(e);
        }

+ 6 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -334,6 +334,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                             @RequestParam(value = "consutlSort", required = true,defaultValue = "DESC")String consutlSort,
                                                            @ApiParam(name = "isAttention", value = "是否关注 1:关注 0:不关注 不传:查所有")
                                                                 @RequestParam(value = "isAttention", required = false)String isAttention,
                                                            @ApiParam(name = "isNurse", value = "是否护师 1:是 0:否 不传:查所有")
                                                                @RequestParam(value = "isNurse", required = false)String isNurse,
                                                            @ApiParam(name = "page", value = "第几页")
                                                             @RequestParam(value = "page",required = false) Integer page,
                                                            @ApiParam(name = "pagesize", value = "分页大小")
@ -345,7 +347,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                    orgCode,dept,
                    diseaseKey,doctorNameKey,
                    jobTitleNameKey,outpatientType,
                    keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
                    keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,isNurse,page,pagesize);
        } catch (Exception e){
            return  failedMixEnvelopException2(e);
        }
@ -380,6 +382,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                            @RequestParam(value = "consutlSort", required = true,defaultValue = "DESC")String consutlSort,
                                                            @ApiParam(name = "isAttention", value = "是否关注 1:关注 0:不关注 不传:查所有")
                                                            @RequestParam(value = "isAttention", required = false)String isAttention,
                                                             @ApiParam(name = "isNurse", value = "是否护师 1:是 0:否 不传:查所有")
                                                                 @RequestParam(value = "isNurse", required = false)String isNurse,
                                                            @ApiParam(name = "page", value = "第几页")
                                                            @RequestParam(value = "page",required = false) Integer page,
                                                            @ApiParam(name = "pagesize", value = "分页大小")
@ -391,7 +395,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                    orgCode,dept,
                    diseaseKey,doctorNameKey,
                    jobTitleNameKey,outpatientType,
                    keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
                    keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,isNurse,page,pagesize);
        } catch (Exception e){
            return  failedMixEnvelopException2(e);
        }

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -385,7 +385,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                               @RequestParam(value = "startTime", required = false) String startTime,
                                                                               @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd’")
                                                                               @RequestParam(value = "endTime", required = false) String endTime,
                                                                               @ApiParam(name = "outpatientType", value = "1复诊2协同3咨询4康复咨询")
                                                                               @ApiParam(name = "outpatientType", value = "1复诊2协同3咨询4康复咨询5护理咨询")
                                                                               @RequestParam(value = "outpatientType", required = false) String outpatientType,
                                                                               @ApiParam(name = "type", value = "outpatientType=1时 type 1=住院申请")
                                                                               @RequestParam(value = "type", required = false) String type,

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

@ -1026,6 +1026,30 @@ class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        return success(result);
    }
    @GetMapping(value = "getArticleTotalManage")
    @ApiOperation(value = "管理员文章统计首页")
    public ObjEnvelop getArticleTotalManage(
            @ApiParam(name = "startDate", value = "开始时间", required = false)
            @RequestParam(value = "startDate", required = false) String startDate,
            @ApiParam(name = "endDate", value = "结束时间", required = false)
            @RequestParam(value = "endDate", required = false) String endDate,
            @ApiParam(name = "area", value = "区域编码 如 level2 area传市编码", required = true)
            @RequestParam(value = "area", required = true) String area,
            @ApiParam(name = "level", value = "2 市  3区  4医院 5、科室 6医生", required = true)
            @RequestParam(value = "level", required = true) int level,
            @ApiParam(name = "flag", value = "0自定义 1本月2近半年3本年", required = true)
            @RequestParam(value = "flag", required = true) Integer flag,
            @ApiParam(name = "slaveKey1", value = "slaveKey1", required = true)
            @RequestParam(value = "slaveKey1", required = false) String slaveKey1) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getArticleTotalManage(flag, startDate, endDate, area, level,slaveKey1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    @GetMapping(value = "getArticleTotalApp")
    @ApiOperation(value = " app文章头部统计")
    public ObjEnvelop getArticleTotalApp(

+ 1 - 1
svr/svr-statistics-hlw/src/main/java/com/yihu/jw/statistics/job/business/MysqlToEsQuotaJob.java

@ -178,7 +178,7 @@ public class MysqlToEsQuotaJob implements Job {
            tjQuotaLog.setJobEndTime(new Date());
            tjQuotaLog.setJobContent(JSONArray.fromObject(filterModel.getErrorModels()).toString());
            saveLog(tjQuotaLog);
            logger.info("========================quotaCode:" + wlyyJobCongId + "," + DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + " end========================");
            logger.info("========================quotaCode:" + wlyyJobCongId + "," + DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + ",timeLevel:" + timeLevel + " end========================");
    /*        }*/
        } catch (Exception e) {
            e.printStackTrace();

+ 5 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/StatisticsController.java

@ -128,10 +128,12 @@ public class StatisticsController extends EnvelopRestEndpoint {
    @GetMapping(value = "deviceAnalysisTop")
    @ApiOperation(value = "设备分析头部统计")
    public ObjEnvelop deviceAnalysisTop(@RequestParam(required = false) String startDate,
                                     @RequestParam(required = false) String endDate) {
    public ObjEnvelop deviceAnalysisTop(@ApiParam(name = "isTH", value = "是否返回同环比 1是 其他否", required = false)
                                        @RequestParam(required = false) String isTH,
                                        @RequestParam(required = false) String startDate,
                                        @RequestParam(required = false) String endDate) {
        try {
            JSONObject json = statisticsService.deviceAnalysisTop(startDate,endDate);
            JSONObject json = statisticsService.deviceAnalysisTop(startDate,endDate,isTH);
            return ObjEnvelop.getSuccess("查询成功",json);
        } catch (Exception e) {
            e.printStackTrace();

+ 212 - 34
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/service/StatisticsService.java

@ -11,6 +11,8 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -402,63 +404,68 @@ public class StatisticsService {
     * 8、【血糖仪上传】:展示查询时间段内所有血糖仪设备的数据上传次数;
     * 9、【血压计上传】:展示查询时间段内所有血压计设备的数据上传次数;
     */
    public JSONObject deviceAnalysisTop(String startDate,String endDate) throws Exception{
    public JSONObject deviceAnalysisTop(String startDate,String endDate,String isTH) throws Exception{
        JSONObject json = new JSONObject();
        // 计算上一个周期  开始时间period[0] 、结束时间period[1]
        String[] period = calculatePreviousPeriod(startDate, endDate);
        //计算去年同期时间段 开始时间periodYear[0] 、结束时间periodYear[1]
        String[] periodYear = calculatePreviousYearPeriod(startDate, endDate);
        String filterDevice = "";
        String filterUpload = "";
        String filterDept = "";
        String filterDeptUse = "";
        String filterDeviceT = "";
        String filterUploadT = "";
        String filterDeptT = "";
        String filterDeptUseT = "";
        String filterDeviceH = "";
        String filterUploadH = "";
        String filterDeptH = "";
        String filterDeptUseH = "";
        if(StringUtils.isNotBlank(startDate)){
            filterDevice += " and d.apply_date>='"+startDate+"' ";
            filterDept += " and apply_date>='"+startDate+"' ";
            filterDeptUse += " and d.apply_date>='"+startDate+"' and i.czrq>='"+startDate+"' ";
            filterUpload += " and czrq>='"+startDate+"' ";
            filterDeviceH += " and d.apply_date>='"+period[0]+"' ";
            filterDeptH += " and apply_date>='"+period[0]+"' ";
            filterDeptUseH += " and d.apply_date>='"+period[0]+"' and i.czrq>='"+period[0]+"' ";
            filterUploadH += " and czrq>='"+period[0]+"' ";
            filterDeviceT += " and d.apply_date>='"+periodYear[0]+"' ";
            filterDeptT += " and apply_date>='"+periodYear[0]+"' ";
            filterDeptUseT += " and d.apply_date>='"+periodYear[0]+"' and i.czrq>='"+periodYear[0]+"' ";
            filterUploadT += " and czrq>='"+periodYear[0]+"' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            filterDevice += " and d.apply_date<='"+endDate+" 23:59:59' ";
            filterDept += " and apply_date<='"+endDate+" 23:59:59' ";
            filterDeptUse += " and d.apply_date<='"+endDate+" 23:59:59' and i.czrq<='"+endDate+" 23:59:59' ";
            filterUpload += " and czrq<='"+endDate+" 23:59:59' ";
            filterDeviceH += " and d.apply_date<='"+period[1]+" 23:59:59' ";
            filterDeptH += " and apply_date<='"+period[1]+" 23:59:59' ";
            filterDeptUseH += " and d.apply_date<='"+period[1]+" 23:59:59' and i.czrq<='"+period[1]+" 23:59:59' ";
            filterUploadH += " and czrq<='"+period[1]+" 23:59:59' ";
            filterDeviceT += " and d.apply_date<='"+periodYear[1]+" 23:59:59' ";
            filterDeptT += " and apply_date<='"+periodYear[1]+" 23:59:59' ";
            filterDeptUseT += " and d.apply_date<='"+periodYear[1]+" 23:59:59' and i.czrq<='"+periodYear[1]+" 23:59:59' ";
            filterUploadT += " and czrq<='"+periodYear[1]+" 23:59:59' ";
        }
        //智能设备总数
        int devcieTotal = 0;
        int devcieXt = 0;//血糖仪数
        int devcieXy = 0;//血压计数
        String deviceSql = "SELECT dm.category_code type,COUNT(d.id) num FROM " +
                "wlyy_devices d INNER JOIN dm_device dm ON d.category_code = dm.id " +
                "where 1=1  " + filterDevice +
                "GROUP BY dm.category_code";
        List<Map<String,Object>> deviceList = jdbcTemplate.queryForList(deviceSql);
        for (Map<String,Object> map:deviceList){
            String type = map.get("type")+"";
            if("1".equals(type)){
                devcieXt = Integer.parseInt(map.get("num")+"");
            }
            if("2".equals(type)){
                devcieXy = Integer.parseInt(map.get("num")+"");
            }
        }
        devcieTotal = devcieXt+devcieXy;
        JSONObject deviceJson = deviceJson(filterDevice);
        int devcieXt = deviceJson.getInteger("devcieXt");//血糖仪数
        int devcieXy = deviceJson.getInteger("devcieXy");//血压计数
        int devcieTotal = devcieXt+devcieXy;
        json.put("devcieTotal",devcieTotal);
        json.put("devcieXt",devcieXt);
        json.put("devcieXy",devcieXy);
        //设备上传次数
        int uploadTotal = 0;
        int uploadXt = 0;//
        int uploadXy = 0;//
        String uploadSql = "select type,count(id) num from wlyy_patient_health_index where 1=1 "+filterUpload+" group by type";
        List<Map<String,Object>> uploadList = jdbcTemplate.queryForList(uploadSql);
        for (Map<String,Object> map:uploadList){
            String type = map.get("type")+"";
            if("1".equals(type)){
                uploadXt = Integer.parseInt(map.get("num")+"");
            }
            if("2".equals(type)){
                uploadXy = Integer.parseInt(map.get("num")+"");
            }
        }
        uploadTotal = uploadXt+uploadXy;
        JSONObject uploadJson = uploadJson(filterUpload);
        int uploadXt = uploadJson.getInteger("uploadXt");//
        int uploadXy = uploadJson.getInteger("uploadXy");//
        int uploadTotal = uploadXt+uploadXy;
        json.put("uploadTotal",uploadTotal);
        json.put("uploadXt",uploadXt);
        json.put("uploadXy",uploadXy);
@ -479,6 +486,121 @@ public class StatisticsService {
        json.put("deptUse",deptUse);
        json.put("bindNum",bindNum);//绑定次数
        if("1".equals(isTH)){
            //同比字段加个H,环比字段加个T
            //智能设备总数同环比
            JSONObject deviceJsonT = deviceJson(filterDeviceT);
            int devcieXtT = deviceJsonT.getInteger("devcieXt");//血糖仪数
            int devcieXyT = deviceJsonT.getInteger("devcieXy");//血压计数
            int devcieTotalT = devcieXtT+devcieXyT;
            JSONObject deviceJsonH = deviceJson(filterDeviceH);
            int devcieXtH = deviceJsonH.getInteger("devcieXt");//血糖仪数
            int devcieXyH = deviceJsonH.getInteger("devcieXy");//血压计数
            int devcieTotalH = devcieXtH+devcieXyH;
            json.put("devcieTotalT",getTwoRange(deptTotal-devcieTotalT,devcieTotalT,0));
            json.put("devcieXtT",getTwoRange(devcieXt-devcieXtT,devcieXtT,0));
            json.put("devcieXyT",getTwoRange(devcieXy-devcieXyT,devcieXyT,0));
            json.put("devcieTotalH",getTwoRange(deptTotal-devcieTotalH,devcieTotalH,0));
            json.put("devcieXtH",getTwoRange(devcieXt-devcieXtH,devcieXtH,0));
            json.put("devcieXyH",getTwoRange(devcieXy-devcieXyH,devcieXyH,0));
            //设备上传次数同环比
            JSONObject uploadJsonT = uploadJson(filterUploadT);
            int uploadXtT = uploadJsonT.getInteger("uploadXt");//
            int uploadXyT = uploadJsonT.getInteger("uploadXy");//
            int uploadTotalT = uploadXtT+uploadXyT;
            json.put("uploadTotalT",getTwoRange(uploadTotal-uploadTotalT,uploadTotalT,0));
            json.put("uploadXtT",getTwoRange(uploadXt-uploadXtT,uploadXtT,0));
            json.put("uploadXyT",getTwoRange(uploadXy-uploadXyT,uploadXyT,0));
            JSONObject uploadJsonH = uploadJson(filterUploadH);
            int uploadXtH = uploadJsonH.getInteger("uploadXt");//
            int uploadXyH = uploadJsonH.getInteger("uploadXy");//
            int uploadTotalH = uploadXtH+uploadXyH;
            json.put("uploadTotalH",getTwoRange(uploadTotal-uploadTotalH,uploadTotalH,0));
            json.put("uploadXtH",getTwoRange(uploadXt-uploadXtH,uploadXtH,0));
            json.put("uploadXyH",getTwoRange(uploadXy-uploadXyH,uploadXyH,0));
            //投放科室数量同环比
            String deptSqlT = "select count(DISTINCT dept) from wlyy_devices where dept is not null "+filterDeptT;
            String deptUseSqlT = "SELECT count(DISTINCT d.dept) from wlyy_devices d,wlyy_patient_health_index i " +
                    "WHERE d.dept is not null and d.device_code=i.device_sn and i.del=1 "+filterDeptUseT;
            int deptTotalT = jdbcTemplate.queryForObject(deptSqlT,Integer.class);
            int deptUseT = jdbcTemplate.queryForObject(deptUseSqlT,Integer.class);
            if(deptUseT>deptTotalT){
                deptUseT = deptTotalT;
            }
            String deptSqlH = "select count(DISTINCT dept) from wlyy_devices where dept is not null "+filterDeptH;
            String deptUseSqlH = "SELECT count(DISTINCT d.dept) from wlyy_devices d,wlyy_patient_health_index i " +
                    "WHERE d.dept is not null and d.device_code=i.device_sn and i.del=1 "+filterDeptUseH;
            int deptTotalH = jdbcTemplate.queryForObject(deptSqlH,Integer.class);
            int deptUseH = jdbcTemplate.queryForObject(deptUseSqlH,Integer.class);
            if(deptUseH>deptTotalH){
                deptUseH = deptTotalH;
            }
            //绑定次数同环比
            String bindSqlT = "SELECT COUNT(*) num from wlyy_patient_device " +
                    " where 1=1 "+filterUploadT;
            int bindNumT = jdbcTemplate.queryForObject(bindSqlT,Integer.class);
            String bindSqlH = "SELECT COUNT(*) num from wlyy_patient_device " +
                    " where 1=1 "+filterUploadH;
            int bindNumH = jdbcTemplate.queryForObject(bindSqlH,Integer.class);
            json.put("deptTotalT",getTwoRange(deptTotal-deptTotalT,deptTotalT,0));
            json.put("deptUseT",getTwoRange(deptUse-deptUseT,deptUseT,0));
            json.put("bindNumT",getTwoRange(bindNum-bindNumT,bindNumT,0));
            json.put("deptTotalH",getTwoRange(deptTotal-deptTotalH,deptTotalH,0));
            json.put("deptUseH",getTwoRange(deptUse-deptUseH,deptUseH,0));
            json.put("bindNumH",getTwoRange(bindNum-bindNumH,bindNumH,0));
        }
        return json;
    }
    public JSONObject uploadJson(String filterUpload){
        int uploadXt = 0;//
        int uploadXy = 0;//
        JSONObject json = new JSONObject();
        String uploadSql = "select type,count(id) num from wlyy_patient_health_index where del=1 "+filterUpload+" group by type";
        List<Map<String,Object>> uploadList = jdbcTemplate.queryForList(uploadSql);
        for (Map<String,Object> map:uploadList){
            String type = map.get("type")+"";
            if("1".equals(type)){
                uploadXt = Integer.parseInt(map.get("num")+"");
            }
            if("2".equals(type)){
                uploadXy = Integer.parseInt(map.get("num")+"");
            }
        }
        json.put("uploadXt",uploadXt);
        json.put("uploadXy",uploadXy);
        return json;
    }
    public JSONObject deviceJson(String filterDevice){
        int devcieXt = 0;//血糖仪数
        int devcieXy = 0;//血压计数
        JSONObject json = new JSONObject();
        String deviceSql = "SELECT dm.category_code type,COUNT(d.id) num FROM " +
                "wlyy_devices d INNER JOIN dm_device dm ON d.category_code = dm.id " +
                "where 1=1  " + filterDevice +
                "GROUP BY dm.category_code";
        List<Map<String,Object>> deviceList = jdbcTemplate.queryForList(deviceSql);
        for (Map<String,Object> map:deviceList){
            String type = map.get("type")+"";
            if("1".equals(type)){
                devcieXt = Integer.parseInt(map.get("num")+"");
            }
            if("2".equals(type)){
                devcieXy = Integer.parseInt(map.get("num")+"");
            }
        }
        json.put("devcieXt",devcieXt);
        json.put("devcieXy",devcieXy);
        return json;
    }
@ -704,4 +826,60 @@ public class StatisticsService {
        String filesize = df.format(size);
        return filesize + "%";
    }
    /**
     * 计算上一个周期。按时间间隔
     */
    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);
        // 计算周期
        int interval = (int) (endDate.toEpochDay() - startDate.toEpochDay()) + 1;
        // 计算上一个周期的开始时间和结束时间
        LocalDate previousStart = startDate.minusDays(interval);
        LocalDate previousEnd = endDate.minusDays(interval);
        // 将日期对象转换为字符串
        String previousStartDate = previousStart.format(DateTimeFormatter.ISO_LOCAL_DATE);
        String previousEndDate = previousEnd.format(DateTimeFormatter.ISO_LOCAL_DATE);
        // 返回上一个周期的时间段
        return new String[]{previousStartDate, previousEndDate};
    }
    /**
     * 计算去年同期时间段
     */
    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);
        // 计算去年同期的开始时间和结束时间
        LocalDate previousStart = startDate.minusYears(1);
        LocalDate previousEnd = endDate.minusYears(1);
        // 将日期对象转换为字符串
        String previousStartDate = previousStart.format(DateTimeFormatter.ISO_LOCAL_DATE);
        String previousEndDate = previousEnd.format(DateTimeFormatter.ISO_LOCAL_DATE);
        // 返回去年同期的时间段
        return new String[]{previousStartDate, previousEndDate};
    }
    public String getTwoRange(int first, int second, int i) {
        if (second == 0 && first > 0) {
            return "100%";
        } else if (second == 0 && first == 0) {
            return "0%";
        }
        float size = (float) (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
        return filesize + "%";
    }
}

+ 4 - 4
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/service/FollowUpService.java

@ -28,7 +28,6 @@ import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.yihu.jw.utils.StringUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
@ -560,17 +559,18 @@ public class FollowUpService {
    }
    //添加康复计划随访
    public Followup addRehabilatationFollowup(ServiceItemPlanDO itemPlanDO)  {
    public Followup addRehabilatationFollowup(ServiceItemPlanDO itemPlanDO,String nextTime)  {
        try {
            Followup followup = new Followup();
            followup.setFollowupType("2");
            Date date = DateUtil.strToDate(itemPlanDO.getPlanTime());
            followup.setFollowupDate(date);
            followup.setFollowupPlanDate(date);
            if(StringUtils.isNotBlank(nextTime)){
                followup.setFollowupNextDate(DateUtil.strToDate(nextTime));
            }
            followup.setDoctorCode(itemPlanDO.getDoctor());
            followup.setDoctorName(itemPlanDO.getDoctorName());
//        followup.setOrgCode(doctor.getHospital());
//        followup.setOrgName(doctor.getHospitalName());
            followup.setPatientCode(itemPlanDO.getPatient());
            BasePatientDO patient = patientDao.findById(itemPlanDO.getPatient()).orElse(null);
            followup.setPatientName(patient.getName());

+ 2 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/controller/ChronicDiseaseController.java

@ -314,7 +314,8 @@ public class ChronicDiseaseController extends EnvelopRestEndpoint {
    @RequestMapping(value = "findLatelyIndex", method = RequestMethod.GET)
    @ApiOperation("获取居民最近一次体征记录")
    public Envelop findLatelyIndex(@ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true) String patient,
                              @ApiParam(name = "type", value = "类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温,7呼吸)") @RequestParam(value = "type", required = true) String type) {
                              @ApiParam(name = "type", value = "类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温,7呼吸)")
                              @RequestParam(value = "type", required = false) String type) {
        try {
            return ObjEnvelop.getSuccess( "查询成功", doctorSchemeService.findLatelyIndex(patient, type));
        } catch (Exception e) {

+ 5 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/scheme/DoctorSchemeService.java

@ -1167,7 +1167,11 @@ public class DoctorSchemeService {
    //获取居民最近一次体征记录
    public DevicePatientHealthIndex findLatelyIndex(String patient,String type){
        String sql = "select * from wlyy_patient_health_index where user='"+patient+"' and type="+type+" order by id desc limit 1 ";
        String sql = "select * from wlyy_patient_health_index where user='"+patient+"' and del=1 ";
        if(StringUtils.isNotBlank(type)){
            sql += " and type="+type+" ";
        }
        sql += " order by id desc limit 1 ";
        List<DevicePatientHealthIndex> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(DevicePatientHealthIndex.class));
        if(list.size()>0){
            return list.get(0);

+ 7 - 2
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationManageService.java

@ -199,7 +199,8 @@ public class RehabilitationManageService {
        int addNum = 0;
        localDateTime = localDateTime.plusDays(addNum);
        List<String> timeList = CronUtils.getExecutionTimeByNum(frequency_code, Integer.parseInt(server_count), localDateTime);
        for (String time : timeList) {
        for (int i = 0; i <timeList.size(); i++){
            String time = timeList.get(i);
            ServiceItemPlanDO itemPlanDO = new ServiceItemPlanDO();
            itemPlanDO.setPlanTime(time);
            itemPlanDO.setPatient(pateint);
@ -211,7 +212,11 @@ public class RehabilitationManageService {
            itemPlanDO.setDoctor(doctor);
            itemPlanDO.setDoctorName(doctorName);
            if ("6".equals(relationType)) {
                Followup followup = followUpService.addRehabilatationFollowup(itemPlanDO);
                String nextTime = null;
                if(i < timeList.size()-1){
                    nextTime = timeList.get(i+1);
                }
                Followup followup = followUpService.addRehabilatationFollowup(itemPlanDO,nextTime);
                if (followup != null) {
                    itemPlanDO.setRelationCode(followup.getId() + "");
                }