liubing 2 роки тому
батько
коміт
55760320a1

+ 144 - 133
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -369,14 +369,14 @@ public class DailyReportUploadService {
                BaseDoctorDO remindDoctorDO = baseDoctorDao.findById(senderID);
                if (remindDoctorDO != null) {
                    try {
                        WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
                        WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,remindDoctorDO.getMobile());
                        if(enterpriseUserDO==null){
                            logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
                        }else{
                            String title = "待办事项";
                            String des = "您好,"+doctorDO.getName()+"已提交每日日报,请点击前往审核。";
                            String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/workSummary/commit?mode=verify&docId="+doctorId;
                            String res = enterpriseService.sendTWMesByDoctor(wechatId,doctorDO.getId(),title,des,url);
                            String res = enterpriseService.sendTWMesByDoctor(wechatId,remindDoctorDO.getId(),title,des,url);
                        }
                    }catch (Exception e){
@ -503,10 +503,10 @@ public class DailyReportUploadService {
        //本人已上报数量
        String benrenshangbaoTotalSql = " select count(1) from base_doctor_daily_report_upload where doctor_id='"+doctorId+"'  ";
        //本人上级未核实事项数
        String benrenVerifiedSql = " select count(de.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
        String benrenVerifiedSql = " select count(distinct up.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
                " where up.doctor_id='"+doctorId+"' and  de.state=1 and report_date>='"+nowDate+"' and report_date<='"+nowDate+"' ";
        //本人上级已核实事项数
        String benrenNotVerifiedSql = " select count(de.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
        String benrenNotVerifiedSql = " select count(distinct up.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
                " where up.doctor_id='"+doctorId+"' and  de.state=0 and report_date>='"+nowDate+"' and report_date<='"+nowDate+"' ";
        //科室总人数
@ -523,10 +523,10 @@ public class DailyReportUploadService {
            //今日上报人数
            sqlTotalSql = " select count(1) from base_doctor_daily_report_upload  where  report_date>='"+nowDate+"' and report_date<='"+nowDate+"' ";
            //今日核实数量
            verifiedSql = " select count(de.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
            verifiedSql = " select count(distinct up.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
                    " where  de.state=1 and report_date>='"+nowDate+"' and report_date<='"+nowDate+"' ";
            //今日未核实数量
            notVerifiedSql = " select count(de.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
            notVerifiedSql = " select count(distinct up.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
                    " where   de.state=0 and report_date>='"+nowDate+"' and report_date<='"+nowDate+"' ";
        } else if (level == 2) {
            //总人次
@ -536,11 +536,11 @@ public class DailyReportUploadService {
            sqlTotalSql = " select count(1) from base_doctor_daily_report_upload  where  report_date>='"+nowDate+"' and report_date<='"+nowDate+"' " +
                    " and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
            //今日核实数量
            verifiedSql = " select count(de.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
            verifiedSql = " select count(distinct up.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
                    " where  de.state=1 and report_date>='"+nowDate+"' and report_date<='"+nowDate+"'" +
                    " and up.doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )  ";
            //今日未核实数量
            notVerifiedSql = " select count(de.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
            notVerifiedSql = " select count(distinct up.id) from base_doctor_daily_report_upload up inner join base_daily_report_detail de on up.id = de.report_id" +
                    " where   de.state=0 and report_date>='"+nowDate+"' and report_date<='"+nowDate+"' " +
                    " and up.doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
        }
@ -568,127 +568,6 @@ public class DailyReportUploadService {
        return result;
    }
    /**
     * 首页统计
     * @param dept
     * @param idType
     * @param state
     * @param startDate
     * @param endDate
     * @param name
     * @return
     */
    public JSONObject selectReportTotal(String dept,String idType,String state,String startDate,String endDate,String name){
        JSONObject object = new JSONObject();
        String day = DateUtil.getTwoDay(endDate, startDate);
        String doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
        Integer total = 0;//总人次
        String sql = "select COUNT(DISTINCT d.id) as \"total\" from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where 1=1 ";
        String deptCondition = "";
        if (StringUtils.isNoneBlank(dept)) {
            deptCondition += " (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
        }
        String idTypeCondition = " ";
        if (StringUtils.isNoneBlank(idType)) {
            idTypeCondition += "  (select d1.id from base_doctor d1 where 1=1 and d1.id_type = '" + idType + "')";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            doctorSql += " and d.id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            doctorSql += " and d.id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            doctorSql += " and d.name like '%" + name + "%' ";
        }
        Integer doctorTotal = jdbcTemplate.queryForObject(doctorSql,Integer.class);
        if (!day.equalsIgnoreCase("0")) {
            total = doctorTotal * (Integer.parseInt(day)+1);
        } else {//当天
            total = doctorTotal;
        }
        Integer yishangbaoTotal=0;//上传人数
        Integer weishangbaoTotal=0;//未上报
        Integer notVerified=0;//未核实
        Integer verified=0;//已核实
        Integer shangchuanTotal=0;//上传总次数
        if (StringUtils.isNoneBlank(startDate)) {
            sql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(state)) {
            sql += " and d.state='"+state+"' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            sql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            sql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            sql += " and d.doctor_name like '%" + name + "%'";
        }
        yishangbaoTotal = jdbcTemplate.queryForObject(sql,Integer.class);
        //未上报
        weishangbaoTotal = total - yishangbaoTotal;
        String shangchuanTotalSql = "select COUNT(1) as \"total\" from base_doctor_daily_report_upload d where 1=1  ";
        if (StringUtils.isNoneBlank(startDate)) {
            shangchuanTotalSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            shangchuanTotalSql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            shangchuanTotalSql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            shangchuanTotalSql += " and d.doctor_name like '%" + name + "%'";
        }
        //未核实数量
        String notVerifiedSql = "select COUNT(DISTINCT de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=0 ";
        //已核实数量
        String verifiedSql = "select COUNT(DISTINCT de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=1 ";
        if (StringUtils.isNoneBlank(startDate)) {
            notVerifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
            verifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            notVerifiedSql += " and d.doctor_id IN " + deptCondition;
            verifiedSql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            notVerifiedSql += " and d.doctor_id IN " + idTypeCondition;
            verifiedSql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            notVerifiedSql += " and d.doctor_name like '%" + name + "%'";
            verifiedSql += " and d.doctor_name like '%" + name + "%'";
        }
        notVerified = jdbcTemplate.queryForObject(notVerifiedSql,Integer.class);
        verified = jdbcTemplate.queryForObject(verifiedSql,Integer.class);
        //上传总次数
        shangchuanTotal = jdbcTemplate.queryForObject(shangchuanTotalSql,Integer.class);
        object.put("total", total);//总人次
        object.put("yishangbaoTotal", yishangbaoTotal);//已上报
        object.put("weishangbaoTotal", weishangbaoTotal);//未上报
        object.put("notVerified", notVerified);//未核实数量
        object.put("verified", verified);//已核实数量
        object.put("shangchuanTotal", shangchuanTotal);//上传总次数
        return object;
    }
    /**
     * 首页按照科室列表统计
     *
@ -725,10 +604,10 @@ public class DailyReportUploadService {
                "LEFT JOIN(select dh.dept_code,count(up.id) 'yishangbaoTotal' from base_doctor_daily_report_upload up INNER JOIN base_doctor d on up.doctor_id = d.id " +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.id " +
                "where 1=1 "+doctorSqlCondition+reportCondition+")dh2 ON hd.CODE = dh2.dept_code " +
                "LEFT JOIN(select dh.dept_code,count(de.id) 'verified' from base_doctor_daily_report_upload up LEFT JOIN base_daily_report_detail de on up.id = de.report_id " +
                "LEFT JOIN(select dh.dept_code,count(distinct up.id) 'verified' from base_doctor_daily_report_upload up LEFT JOIN base_daily_report_detail de on up.id = de.report_id " +
                "INNER JOIN base_doctor d on up.doctor_id = d.id LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.id " +
                "where 1=1 and de.state=1 "+doctorSqlCondition+reportCondition+" )dh3 ON hd.CODE = dh3.dept_code " +
                "LEFT JOIN(select dh.dept_code,count(de.id) 'notVerified' from base_doctor_daily_report_upload up LEFT JOIN base_daily_report_detail de on up.id = de.report_id " +
                "LEFT JOIN(select dh.dept_code,count(distinct up.id) 'notVerified' from base_doctor_daily_report_upload up LEFT JOIN base_daily_report_detail de on up.id = de.report_id " +
                "INNER JOIN base_doctor d on up.doctor_id = d.id LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.id " +
                "where 1=1 and de.state=0 "+doctorSqlCondition+reportCondition+")dh4 ON hd.CODE = dh4.dept_code " +
                "LEFT JOIN(select dh.dept_code,count(up.id) 'shangchuanTotal' from base_doctor_daily_report_upload up INNER JOIN base_doctor d on up.doctor_id = d.id " +
@ -1201,8 +1080,140 @@ public class DailyReportUploadService {
        object.put("total", total);//总人次
        object.put("yishangbaoTotal", yishangbaoTotal);//已上报
        object.put("weishangbaoTotal", weishangbaoTotal);//未上报
        object.put("verifiedTotal", verifiedTotal);//上报正常
        object.put("notVerifiedTotal", notVerifiedTotal);//上报异常
        object.put("verifiedTotal", verifiedTotal);//已核实
        object.put("notVerifiedTotal", notVerifiedTotal);//未核实
        object.put("shangchuanTotal", shangchuanTotal);//上传总次数
        return object;
    }
    /**
     * 首页统计
     *
     * @param dept
     * @param idType
     * @param status
     * @param state
     * @param startDate
     * @param endDate
     * @return
     */
    public JSONObject selectHeaderTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name) {
        JSONObject object = new JSONObject();
        String day = DateUtil.getTwoDay(endDate, startDate);
        String doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
        Integer total = 0;//总人次
        String sql = "select COUNT(DISTINCT d.id) as \"total\" from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where 1=1 ";
        String deptCondition = "";
        if (StringUtils.isNoneBlank(dept)) {
            deptCondition += " (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
        }
        String idTypeCondition = " ";
        if (StringUtils.isNoneBlank(idType)) {
            idTypeCondition += "  (select d1.id from base_doctor d1 where 1=1 and d1.id_type = '" + idType + "')";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            doctorSql += " and d.id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            doctorSql += " and d.id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            doctorSql += " and d.name like '%" + name + "%' ";
        }
//        if (StringUtils.isNoneBlank(status)) {
//            if (status.equalsIgnoreCase("1")) {//已上报
//                doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + startDate + "' and d1.report_date<='" + endDate + "' ) ";
//            } else if (status.equalsIgnoreCase("2")) {//未上报
//                doctorSql += " and d.id not in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + startDate + "' and d1.report_date<='" + endDate + "' ) ";
//            }
//        }
        Integer doctorTotal = jdbcTemplate.queryForObject(doctorSql,Integer.class);
        if (!day.equalsIgnoreCase("0")) {
            total = doctorTotal * (Integer.parseInt(day)+1);
        } else {//当天
            total = doctorTotal;
        }
        Integer yishangbaoTotal=0;//上传人数
        Integer weishangbaoTotal=0;//未上报
        Integer notVerified=0;//未核实
        Integer verified=0;//已核实
        Integer shangchuanTotal=0;//上传总次数
        if (StringUtils.isNoneBlank(startDate)) {
            sql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(state)) {
            sql += " and d.state='"+state+"' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            sql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            sql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            sql += " and d.doctor_name like '%" + name + "%'";
        }
        yishangbaoTotal = jdbcTemplate.queryForObject(sql,Integer.class);
        //未上报
        weishangbaoTotal = total - yishangbaoTotal;
        String shangchuanTotalSql = "select COUNT(1) as \"total\" from base_doctor_daily_report_upload d where 1=1  ";
        if (StringUtils.isNoneBlank(startDate)) {
            shangchuanTotalSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            shangchuanTotalSql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            shangchuanTotalSql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            shangchuanTotalSql += " and d.doctor_name like '%" + name + "%'";
        }
        //未核实数量
        String notVerifiedSql = "select COUNT(DISTINCT d.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=0 ";
        //已核实数量
        String verifiedSql = "select COUNT(DISTINCT d.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=1 ";
        if (StringUtils.isNoneBlank(startDate)) {
            notVerifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
            verifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            notVerifiedSql += " and d.doctor_id IN " + deptCondition;
            verifiedSql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            notVerifiedSql += " and d.doctor_id IN " + idTypeCondition;
            verifiedSql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            notVerifiedSql += " and d.doctor_name like '%" + name + "%'";
            verifiedSql += " and d.doctor_name like '%" + name + "%'";
        }
        notVerified = jdbcTemplate.queryForObject(notVerifiedSql,Integer.class);
        verified = jdbcTemplate.queryForObject(verifiedSql,Integer.class);
        //上传总次数
        shangchuanTotal = jdbcTemplate.queryForObject(shangchuanTotalSql,Integer.class);
        object.put("total", total);//总人次
        object.put("yishangbaoTotal", yishangbaoTotal);//已上报
        object.put("weishangbaoTotal", weishangbaoTotal);//未上报
        object.put("notVerified", notVerified);//未核实数量
        object.put("verified", verified);//已核实数量
        object.put("shangchuanTotal", shangchuanTotal);//上传总次数
        return object;
    }

+ 44 - 40
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/DailyReportService.java

@ -127,7 +127,7 @@ public class DailyReportService {
                            "where d.del=1 and dh.del=1 and dh.dept_code='" + dept_code + "' )  ";
                    Integer sqlTotal = jdbcTemplate.queryForObject(uploadSql, Integer.class);
                    Integer weishangbaoTotal = doctorTotal - sqlTotal;
                    String title = "日报未上报汇总";
                    String title = "每日日报未上报汇总";
                    String des = "今日还有" + weishangbaoTotal + "人未提交健康信息,点击查看。";
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId, doctorDO.getId(), title, des, url);
@ -139,21 +139,23 @@ public class DailyReportService {
        List<String> adminDoctorS = jdbcTemplate.queryForList(adminDoctorSql,String.class);
        if (adminDoctorS.size()>0){
            BaseDoctorDO doctorDO = doctorDao.findById(boosID);
            WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId, doctorDO.getMobile());
            if (enterpriseUserDO == null) {
                logger.info("该用户" + doctorDO.getName() + "没有企业微信手机号,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:" + wechatId);
            } else {
                String doctorSql = " select COUNT(distinct d.id) as 'total' from base_doctor d and d.id in ( "+adminDoctorSql+" )  ";
                Integer doctorTotal = jdbcTemplate.queryForObject(doctorSql, Integer.class);
                //查询出已经上传人数
                String uploadSql = " select count(1) from base_doctor_daily_report_upload up " +
                        "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.doctor_id in ( "+adminDoctorSql+" )  ";
                Integer sqlTotal = jdbcTemplate.queryForObject(uploadSql, Integer.class);
                Integer weishangbaoTotal = doctorTotal - sqlTotal;
                String title = "日报未上报汇总";
                String des = "今日还有" + weishangbaoTotal + "人未提交健康信息,点击查看。";
                String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                String res = enterpriseService.sendTWMesByDoctor(wechatId, doctorDO.getId(), title, des, url);
            if (doctorDO!=null){
                WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId, doctorDO.getMobile());
                if (enterpriseUserDO == null) {
                    logger.info("该用户" + doctorDO.getName() + "没有企业微信手机号,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:" + wechatId);
                } else {
                    String doctorSql = " select COUNT(distinct d.id) as 'total' from base_doctor d and d.id in ( "+adminDoctorSql+" )  ";
                    Integer doctorTotal = jdbcTemplate.queryForObject(doctorSql, Integer.class);
                    //查询出已经上传人数
                    String uploadSql = " select count(1) from base_doctor_daily_report_upload up " +
                            "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.doctor_id in ( "+adminDoctorSql+" )  ";
                    Integer sqlTotal = jdbcTemplate.queryForObject(uploadSql, Integer.class);
                    Integer weishangbaoTotal = doctorTotal - sqlTotal;
                    String title = "每日日报未上报汇总";
                    String des = "今日还有" + weishangbaoTotal + "人未提交健康信息,点击查看。";
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId, doctorDO.getId(), title, des, url);
                }
            }
        }
    }
@ -204,7 +206,7 @@ public class DailyReportService {
                            " select d.id from base_doctor d  INNER JOIN base_doctor_hospital dh on d.id = dh.doctor_code " +
                            "where d.del=1 and dh.del=1 and dh.dept_code='" + dept_code + "' )  ";
                    Integer notVerifiedTotal = jdbcTemplate.queryForObject(notVerifiedTotalSql,Integer.class);
                    String title = "日报上报汇总";
                    String title = "每日日报上报汇总";
                    String des = "今日上报情况:已上报:"+yishangbaoTotal+" 未上报:"+weishangbaoTotal+"已核实:"+verifiedTotal+"未核实:" + notVerifiedTotal + ";点击查看;";
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId, doctorDO.getId(), title, des, url);
@ -216,29 +218,31 @@ public class DailyReportService {
        List<String> adminDoctorS = jdbcTemplate.queryForList(adminDoctorSql,String.class);
        if (adminDoctorS.size()>0){
            BaseDoctorDO doctorDO = doctorDao.findById(boosID);
            WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId, doctorDO.getMobile());
            if (enterpriseUserDO == null) {
                logger.info("该用户" + doctorDO.getName() + "没有企业微信手机号,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:" + wechatId);
            } else {
                String doctorSql = " select COUNT(distinct d.id) as 'total' from base_doctor d and d.id in ( "+adminDoctorSql+" )  ";
                Integer doctorTotal = jdbcTemplate.queryForObject(doctorSql, Integer.class);
                //查询出已经上传人数
                String uploadSql = " select count(1) from base_doctor_daily_report_upload up " +
                        "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.doctor_id in ( "+adminDoctorSql+" )  ";
                Integer yishangbaoTotal = jdbcTemplate.queryForObject(uploadSql, Integer.class);
                Integer weishangbaoTotal = doctorTotal - yishangbaoTotal;
                //已核实
                String verifiedTotalSql = " select count(1) from base_doctor_daily_report_upload up " +
                        "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.state=1 and up.doctor_id in ( "+adminDoctorSql+" )  ";
                Integer verifiedTotal = jdbcTemplate.queryForObject(verifiedTotalSql,Integer.class);
                //未核实
                String notVerifiedTotalSql = " select count(1) from base_doctor_daily_report_upload up " +
                        "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.state=0 and up.doctor_id in ( "+adminDoctorSql+" )  ";
                Integer notVerifiedTotal = jdbcTemplate.queryForObject(notVerifiedTotalSql,Integer.class);
                String title = "日报上报汇总";
                String des = "今日上报情况:已上报:"+yishangbaoTotal+" 未上报:"+weishangbaoTotal+"已核实:"+verifiedTotal+"未核实:" + notVerifiedTotal + ";点击查看;";
                String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                String res = enterpriseService.sendTWMesByDoctor(wechatId, doctorDO.getId(), title, des, url);
            if (doctorDO!=null){
                WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId, doctorDO.getMobile());
                if (enterpriseUserDO == null) {
                    logger.info("该用户" + doctorDO.getName() + "没有企业微信手机号,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:" + wechatId);
                } else {
                    String doctorSql = " select COUNT(distinct d.id) as 'total' from base_doctor d where 1=1 and d.id in ( "+adminDoctorSql+" )  ";
                    Integer doctorTotal = jdbcTemplate.queryForObject(doctorSql, Integer.class);
                    //查询出已经上传人数
                    String uploadSql = " select count(1) from base_doctor_daily_report_upload up " +
                            "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.doctor_id in ( "+adminDoctorSql+" )  ";
                    Integer yishangbaoTotal = jdbcTemplate.queryForObject(uploadSql, Integer.class);
                    Integer weishangbaoTotal = doctorTotal - yishangbaoTotal;
                    //已核实
                    String verifiedTotalSql = " select count(1) from base_doctor_daily_report_upload up " +
                            "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.state=1 and up.doctor_id in ( "+adminDoctorSql+" )  ";
                    Integer verifiedTotal = jdbcTemplate.queryForObject(verifiedTotalSql,Integer.class);
                    //未核实
                    String notVerifiedTotalSql = " select count(1) from base_doctor_daily_report_upload up " +
                            "where up.report_date>='" + nowDate + "' and up.report_date<='" + nowDate + "' and up.state=0 and up.doctor_id in ( "+adminDoctorSql+" )  ";
                    Integer notVerifiedTotal = jdbcTemplate.queryForObject(notVerifiedTotalSql,Integer.class);
                    String title = "每日日报上报汇总";
                    String des = "今日上报情况:已上报:"+yishangbaoTotal+" 未上报:"+weishangbaoTotal+"已核实:"+verifiedTotal+"未核实:" + notVerifiedTotal + ";点击查看;";
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId, doctorDO.getId(), title, des, url);
                }
            }
        }
    }

+ 15 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -1014,4 +1014,19 @@ public class JobController extends BaseController {
        }
    }
    @RequestMapping(value = "/testNow", method = RequestMethod.POST)
    @ApiOperation("立即执行")
    public String executeSignFamilyPayResultJob(String className) {
        try {
            String uuid = getUID();
            Class c1 = Class.forName(className);//com.yihu.jw.care.job.consult.FinishConsultJob
            quartzHelper.startNow(c1, uuid, null);
            quartzHelper.removeJob(uuid);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 4 - 4
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -41,11 +41,11 @@ health_upload_weishangbao_remind_job=0 45 8 * * ? *
health_upload_total_remind_job=0 0 9 * * ? *
DailyReportRemindJob=0 0 18 * * ? *
DailyReportRemindJob=0 50 17 * * ? *
DailyReportRemindSecondJob=0 30 18 * * ? *
DailyReportRemindSecondJob=0 0 20 * * ? *
DailyReportTotalRemindJob=0 30 18 * * ? *
DailyReportTotalRemindJob=0 0 22 * * ? *
DailyReportWsbTotalRemindJob=0 0 22 * * ? *
DailyReportWsbTotalRemindJob=0 0 21 * * ? *

+ 24 - 22
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dailyReport/DailyReportUploadPoint.java

@ -233,28 +233,6 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "selectReportTotal")
    @ApiOperation(value = "首页统计")
    public ObjEnvelop selectReportTotal(@ApiParam(name = "dept", value = "科室code")
                                        @RequestParam(value = "dept", required = false) String dept,
                                        @ApiParam(name = "idType", value = "身份类别")
                                        @RequestParam(value = "idType", required = false) String idType,
                                        @ApiParam(name = "state", value = "核实状态0未核实1已核实")
                                        @RequestParam(value = "state", required = false) String state,
                                        @ApiParam(name = "startDate", value = "开始日期yyyy-MM-dd")
                                        @RequestParam(value = "startDate", required = false) String startDate,
                                        @ApiParam(name = "endDate", value = "结束日期")
                                        @RequestParam(value = "endDate", required = false) String endDate,
                                        @ApiParam(name = "name", value = "姓名")
                                        @RequestParam(value = "name", required = false) String name) {
        try {
            JSONObject jsonObject = dailyReportUploadService.selectReportTotal(dept,idType,state,startDate,endDate,name);
            return success(jsonObject);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "selectHeaderList")
    @ApiOperation(value = "首页按照科室统计")
    public ListEnvelop selectHeaderList(@ApiParam(name = "dept", value = "科室code")
@ -387,4 +365,28 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = "selectHeaderTotal")
    @ApiOperation(value = "首页统计")
    public ObjEnvelop selectHeaderTotal(@ApiParam(name = "dept", value = "科室code")
                                        @RequestParam(value = "dept", required = false) String dept,
                                        @ApiParam(name = "idType", value = "身份类别")
                                        @RequestParam(value = "idType", required = false) String idType,
                                        @ApiParam(name = "status", value = "上报状态1已上报 2未上报")
                                        @RequestParam(value = "status", required = false) String status,
                                        @ApiParam(name = "state", value = "核实状态0未核实1已核实")
                                        @RequestParam(value = "state", required = false) String state,
                                        @ApiParam(name = "startDate", value = "开始时间")
                                        @RequestParam(value = "startDate", required = false) String startDate,
                                        @ApiParam(name = "endDate", value = "结束时间")
                                        @RequestParam(value = "endDate", required = false) String endDate,
                                        @ApiParam(name = "name", value = "姓名")
                                        @RequestParam(value = "name", required = false) String name) {
        try {
            JSONObject jsonObject = dailyReportUploadService.selectHeaderTotal(dept,idType,status,state,startDate,endDate,name);
            return success(jsonObject);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}