Browse Source

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
wangzhinan 2 years ago
parent
commit
640c106a4d

+ 24 - 1
business/base-service/src/main/java/com/yihu/jw/healthUpload/service/BaseDoctorHealthUploadService.java

@ -810,18 +810,41 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            if (StringUtils.isNoneBlank(name)) {
                sqlYichang += " and d.doctor_name like '%" + name + "%'";
            }
            //正常
            //异常
            Map<String, Object> yichangMap = jdbcTemplate.queryForMap(sqlYichang);
            if (yichangMap != null) {
                if (yichangMap.get("total") != null) {
                    yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
                }
            }
            String sqlDistintYichang = "select COUNT(DISTINCT doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)  ";
            if (StringUtils.isNoneBlank(startDate)) {
                sqlDistintYichang += " and d.create_time >='" + startDate + " 00:00:00' and d.create_time<='" + endDate + " 23:59:59' ";
            }
            if (StringUtils.isNoneBlank(deptCondition)) {
                sqlDistintYichang += " and d.doctor_id IN " + deptCondition;
            }
            if (StringUtils.isNoneBlank(idTypeCondition)) {
                sqlDistintYichang += " and d.doctor_id IN " + idTypeCondition;
            }
            if (StringUtils.isNoneBlank(name)) {
                sqlDistintYichang += " and d.doctor_name like '%" + name + "%'";
            }
            Integer yichangPersonTotal =0;
            //异常
            Map<String, Object> sqlDistintYichangMap = jdbcTemplate.queryForMap(sqlDistintYichang);
            if (sqlDistintYichangMap != null) {
                if (sqlDistintYichangMap.get("total") != null) {
                    yichangPersonTotal = Integer.parseInt(sqlDistintYichangMap.get("total").toString());
                }
            }
            object.put("total", total);//总人次
            object.put("yishangbaoTotal", yishangbaoTotal);//已上报
            object.put("weishangbaoTotal", weishangbaoTotal);//未上报
            object.put("zhengchangTotal", zhengchangTotal);//上报正常
            object.put("yichangTotal", yichangTotal);//上报异常
            object.put("yichangPersonTotal", yichangPersonTotal);//上报人异常
            object.put("shangchuanTotal", shangchuanTotal);//上传总次数
            deptmap.put("tongyishuju", object);
        }

+ 29 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadRemindMessageJob.java

@ -0,0 +1,29 @@
package com.yihu.jw.job;
import com.yihu.jw.service.channel.HealthUploadService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Trick on 2019/10/15.
 */
public class HealthUploadRemindMessageJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(HealthUploadRemindMessageJob.class);
    @Autowired
    private HealthUploadService healthUploadService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========SendDoctorHealthUploadMessageJob========");
        try {
            healthUploadService.healthUploadRemind();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===SendDoctorHealthUploadMessageJob,message:"+e.getMessage());
        }
    }
}

+ 29 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadSecondRemindMessageJob.java

@ -0,0 +1,29 @@
package com.yihu.jw.job;
import com.yihu.jw.service.channel.HealthUploadService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Trick on 2019/10/15.
 */
public class HealthUploadSecondRemindMessageJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(HealthUploadSecondRemindMessageJob.class);
    @Autowired
    private HealthUploadService healthUploadService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========SendDoctorHealthUploadMessageJob========");
        try {
            healthUploadService.healthUploadRemind();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===SendDoctorHealthUploadMessageJob,message:"+e.getMessage());
        }
    }
}

+ 29 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadTotalRemindMessageJob.java

@ -0,0 +1,29 @@
package com.yihu.jw.job;
import com.yihu.jw.service.channel.HealthUploadService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Trick on 2019/10/15.
 */
public class HealthUploadTotalRemindMessageJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(HealthUploadTotalRemindMessageJob.class);
    @Autowired
    private HealthUploadService healthUploadService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========SendDoctorHealthUploadMessageJob========");
        try {
            healthUploadService.healthUploadTotalRemind();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===SendDoctorHealthUploadMessageJob,message:"+e.getMessage());
        }
    }
}

+ 29 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadWeishangbaoRemindMessageJob.java

@ -0,0 +1,29 @@
package com.yihu.jw.job;
import com.yihu.jw.service.channel.HealthUploadService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Trick on 2019/10/15.
 */
public class HealthUploadWeishangbaoRemindMessageJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(HealthUploadWeishangbaoRemindMessageJob.class);
    @Autowired
    private HealthUploadService healthUploadService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========SendDoctorHealthUploadMessageJob========");
        try {
            healthUploadService.healthUploadWsbTotalRemind();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===SendDoctorHealthUploadMessageJob,message:"+e.getMessage());
        }
    }
}

+ 255 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/HealthUploadService.java

@ -4,12 +4,17 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.*;
import com.yihu.jw.entity.healthUpload.BaseDoctorHealthUploadDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.enterprise.WxEnterpriseUserDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
@ -48,6 +53,8 @@ import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxPushLogDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.dao.WxTemplateDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.enterprise.dao.WxEnterpriseUserDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -55,6 +62,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
@ -87,6 +95,16 @@ public class HealthUploadService {
    private BaseDoctorHealthUploadDao doctorHealthUploadDao;
    @Autowired
    private WxPushLogDao wxPushLogDao;
    @Autowired
    private WxEnterpriseUserDao wxEnterpriseUserDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Autowired
    private BaseDoctorRoleDao doctorRoleDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    public void waitingItem(){
        List<BaseDoctorDO> doctorDOList = doctorDao.findByDel();
@ -119,5 +137,242 @@ public class HealthUploadService {
        }
    }
    /**
     * 健康上报填写提醒
     *
     * @throws Exception
     */
    public void healthUploadRemind() throws Exception {
        List<BaseDoctorDO> doctorDOList = doctorDao.findByDel();
        Date startDate = DateUtil.strToDate(DateUtil.getStringDateShort()+" 00:00:00");
        Date endDate = DateUtil.strToDate(DateUtil.getStringDateShort()+" 23:59:59");
        for (BaseDoctorDO doctorDO:doctorDOList){
            List<BaseDoctorHealthUploadDO> healthUploadDOS = doctorHealthUploadDao.selectHealthUploadInfoByDoctorIdAndStartAndEnd(doctorDO.getId(),startDate,endDate);
            if (healthUploadDOS==null||healthUploadDOS.size()==0){
                WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
                if(enterpriseUserDO==null){
                    logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
                }else{
                    String title = "待办事项";
                    String des = "您好,系统检测到您今日尚未提交健康信息,请及时提交!";
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/health/commit";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId,doctorDO.getId(),title,des,url);
                }
            }
        }
    }
    public void healthUploadWsbTotalRemind() throws Exception {
        List<BaseDoctorRoleDO> adminRoleList = doctorRoleDao.findByRoleCode("admin");
        List<BaseDoctorRoleDO> deptAdminRoleList = doctorRoleDao.findByRoleCode("deptAdmin");
        //管理员
        for (BaseDoctorRoleDO adminRole:adminRoleList){
            BaseDoctorDO doctorDO = doctorDao.findById(adminRole.getDoctorCode());
            WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
            if(enterpriseUserDO==null){
                logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
            }else{
                //总人数
                Integer doctorTotal=0;
                String doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
                Map<String, Object> doctorMap = jdbcTemplate.queryForMap(doctorSql);
                if (doctorMap != null) {
                    if (doctorMap.get("total") != null) {
                        doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                    }
                }
                if (doctorMap != null) {
                    if (doctorMap.get("total") != null) {
                        doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                    }
                }
                String nowDate = DateUtil.getStringDateShort();
                //已上报人数
                Integer sqlTotal = 0;
                String sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' ";
                Map<String, Object> sqlMap = jdbcTemplate.queryForMap(sql);
                if (sqlMap != null) {
                    if (sqlMap.get("total") != null) {
                        sqlTotal = Integer.parseInt(sqlMap.get("total").toString());
                    }
                }
                //异常人数
                //今日异常人次
                String yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
                Integer yichangTotal=0;
                Map<String, Object> yichangMap = jdbcTemplate.queryForMap(yichangSql);
                if (yichangMap != null) {
                    if (yichangMap.get("total") != null) {
                        yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
                    }
                }
                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);
            }
        }
        //科室管理员
        for (BaseDoctorRoleDO deptRole:deptAdminRoleList){
            BaseDoctorDO doctorDO = doctorDao.findById(deptRole.getDoctorCode());
            WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
            if(enterpriseUserDO==null){
                logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
            }else{
                List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(deptRole.getDoctorCode());
                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                    String dept = doctorHospitalDOS.get(0).getDeptCode();
                    //总人数
                    Integer doctorTotal=0;
                    String doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 and id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
                    Map<String, Object> doctorMap = jdbcTemplate.queryForMap(doctorSql);
                    if (doctorMap != null) {
                        if (doctorMap.get("total") != null) {
                            doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                        }
                    }
                    if (doctorMap != null) {
                        if (doctorMap.get("total") != null) {
                            doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                        }
                    }
                    String nowDate = DateUtil.getStringDateShort();
                    //已上报人数
                    Integer sqlTotal = 0;
                    String sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
                    Map<String, Object> sqlMap = jdbcTemplate.queryForMap(sql);
                    if (sqlMap != null) {
                        if (sqlMap.get("total") != null) {
                            sqlTotal = Integer.parseInt(sqlMap.get("total").toString());
                        }
                    }
                    //异常人数
                    //今日异常人次
                    String yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
                    Integer yichangTotal=0;
                    Map<String, Object> yichangMap = jdbcTemplate.queryForMap(yichangSql);
                    if (yichangMap != null) {
                        if (yichangMap.get("total") != null) {
                            yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
                        }
                    }
                    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);
                }
            }
        }
    }
    public void healthUploadTotalRemind() throws Exception {
        List<BaseDoctorRoleDO> adminRoleList = doctorRoleDao.findByRoleCode("admin");
        List<BaseDoctorRoleDO> deptAdminRoleList = doctorRoleDao.findByRoleCode("deptAdmin");
        //管理员
        for (BaseDoctorRoleDO adminRole:adminRoleList){
            BaseDoctorDO doctorDO = doctorDao.findById(adminRole.getDoctorCode());
            WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
            if(enterpriseUserDO==null){
                logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
            }else{
                //总人数
                Integer doctorTotal=0;
                String doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
                Map<String, Object> doctorMap = jdbcTemplate.queryForMap(doctorSql);
                if (doctorMap != null) {
                    if (doctorMap.get("total") != null) {
                        doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                    }
                }
                if (doctorMap != null) {
                    if (doctorMap.get("total") != null) {
                        doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                    }
                }
                String nowDate = DateUtil.getStringDateShort();
                //已上报人数
                Integer sqlTotal = 0;
                String sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' ";
                Map<String, Object> sqlMap = jdbcTemplate.queryForMap(sql);
                if (sqlMap != null) {
                    if (sqlMap.get("total") != null) {
                        sqlTotal = Integer.parseInt(sqlMap.get("total").toString());
                    }
                }
                //异常人数
                //今日异常人次
                String yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
                Integer yichangTotal=0;
                Map<String, Object> yichangMap = jdbcTemplate.queryForMap(yichangSql);
                if (yichangMap != null) {
                    if (yichangMap.get("total") != null) {
                        yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
                    }
                }
                Integer weishangbaoTotal = doctorTotal-sqlTotal;
                String title = "每日健康上报汇总";
                String des = "今日上报情况:已上报:"+sqlTotal+",未上报:"+weishangbaoTotal+",异常:"+yichangTotal+";点击查看。";
                String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                String res = enterpriseService.sendTWMesByDoctor(wechatId,doctorDO.getId(),title,des,url);
            }
        }
        //科室管理员
        for (BaseDoctorRoleDO deptRole:deptAdminRoleList){
            BaseDoctorDO doctorDO = doctorDao.findById(deptRole.getDoctorCode());
            WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
            if(enterpriseUserDO==null){
                logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
            }else{
                List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(deptRole.getDoctorCode());
                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                    String dept = doctorHospitalDOS.get(0).getDeptCode();
                    //总人数
                    Integer doctorTotal=0;
                    String doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 and id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
                    Map<String, Object> doctorMap = jdbcTemplate.queryForMap(doctorSql);
                    if (doctorMap != null) {
                        if (doctorMap.get("total") != null) {
                            doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                        }
                    }
                    if (doctorMap != null) {
                        if (doctorMap.get("total") != null) {
                            doctorTotal = Integer.parseInt(doctorMap.get("total").toString());
                        }
                    }
                    String nowDate = DateUtil.getStringDateShort();
                    //已上报人数
                    Integer sqlTotal = 0;
                    String sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
                    Map<String, Object> sqlMap = jdbcTemplate.queryForMap(sql);
                    if (sqlMap != null) {
                        if (sqlMap.get("total") != null) {
                            sqlTotal = Integer.parseInt(sqlMap.get("total").toString());
                        }
                    }
                    //异常人数
                    //今日异常人次
                    String yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
                    Integer yichangTotal=0;
                    Map<String, Object> yichangMap = jdbcTemplate.queryForMap(yichangSql);
                    if (yichangMap != null) {
                        if (yichangMap.get("total") != null) {
                            yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
                        }
                    }
                    Integer weishangbaoTotal = doctorTotal-sqlTotal;
                    String title = "每日健康上报汇总";
                    String des = "今日上报情况:已上报:"+sqlTotal+",未上报:"+weishangbaoTotal+",异常:"+yichangTotal+";点击查看。";
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId,doctorDO.getId(),title,des,url);
                }
            }
        }
    }
}

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

@ -30,6 +30,7 @@ import com.yihu.jw.web.BaseController;
import com.yihu.jw.wechat.service.WxTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -232,6 +233,46 @@ public class JobController extends BaseController {
                        logger.info("send_health_upload_job  job exist");
                    }
                    break;
                case "health_upload_remind_job" :
                    //健康上报未填写通知
                    if (!quartzHelper.isExistJob("health_upload_remind_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("health_upload_remind_job");
                        quartzHelper.addJob(HealthUploadRemindMessageJob.class, trigger, "health_upload_remind_job", new HashMap<String, Object>());
                        logger.info("health_upload_remind_job  job success");
                    } else {
                        logger.info("health_upload_remind_job  job exist");
                    }
                    break;
                case "second_health_upload_remind_job" :
                    //健康上报未填写二次通知
                    if (!quartzHelper.isExistJob("second_health_upload_remind_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("second_health_upload_remind_job");
                        quartzHelper.addJob(HealthUploadSecondRemindMessageJob.class, trigger, "second_health_upload_remind_job", new HashMap<String, Object>());
                        logger.info("second_health_upload_remind_job  job success");
                    } else {
                        logger.info("second_health_upload_remind_job  job exist");
                    }
                    break;
                case "health_upload_weishangbao_remind_job" :
                    //健康上报未上报汇总
                    if (!quartzHelper.isExistJob("health_upload_weishangbao_remind_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("health_upload_weishangbao_remind_job");
                        quartzHelper.addJob(HealthUploadWeishangbaoRemindMessageJob.class, trigger, "health_upload_weishangbao_remind_job", new HashMap<String, Object>());
                        logger.info("health_upload_weishangbao_remind_job  job success");
                    } else {
                        logger.info("health_upload_weishangbao_remind_job  job exist");
                    }
                    break;
                case "health_upload_total_remind_job" :
                    //健康上报上报汇总
                    if (!quartzHelper.isExistJob("health_upload_total_remind_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("health_upload_total_remind_job");
                        quartzHelper.addJob(HealthUploadTotalRemindMessageJob.class, trigger, "health_upload_total_remind_job", new HashMap<String, Object>());
                        logger.info("health_upload_total_remind_job  job success");
                    } else {
                        logger.info("health_upload_total_remind_job  job exist");
                    }
                    break;
                case "syn_doctor_info_job" :
                    //互联网医院 医生信息同步
                    if (!quartzHelper.isExistJob("syn_doctor_info_job")) {
@ -535,7 +576,7 @@ public class JobController extends BaseController {
    @RequestMapping(value = "/waitingItem", method = RequestMethod.POST)
    @ApiOperation("测试健康上报推送")
    public String waitingItem(String doctor,String date) {
    public String waitingItem() {
        try {
            healthUploadService.waitingItem();
            return write(200, "测试推送成功");
@ -545,6 +586,25 @@ public class JobController extends BaseController {
        }
    }
    @RequestMapping(value = "/healthUploadRemind", method = RequestMethod.POST)
    @ApiOperation("测试健康上报推送")
    public String healthUploadRemind(@ApiParam(name = "flag", value = "1未上报提醒2未上报汇总3每日汇总")
                                  @RequestParam(value = "flag", required = false) Integer flag) {
        try {
            if (flag==1){
                healthUploadService.healthUploadRemind();
            }else if (flag==2){
                healthUploadService.healthUploadWsbTotalRemind();
            }else if (flag==3){
                healthUploadService.healthUploadTotalRemind();
            }
            return write(200, "测试推送成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "测试推送失败");
        }
    }
    @RequestMapping(value = "/delData", method = RequestMethod.POST)
    @ApiOperation("删除数据")
    public String delData(String doctor,String date) {

+ 39 - 0
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -429,3 +429,42 @@ express:
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
jobs:
  schedule: 0 */30 * * * ?
---
spring:
  profiles: ZjxlProd
  datasource:
    url: jdbc:mysql://172.26.0.13/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: jkzlehr
hlwyyEntrance:
  url: http://localhost:10023
demo:
  flag: true
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_zjxl_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  ids: xm_zjxl_wx
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
jobs:
  schedule: 0 */1 * * * ?

+ 7 - 0
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -68,3 +68,10 @@ spring:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.250.39:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: ZjxlProd
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}

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

@ -31,3 +31,11 @@ syn_doctor_info_job=0 0 1 * * ?
send_health_upload_job=0 0 10/1 * * ?
health_upload_remind_job=0 30 8 * * ? *
second_health_upload_remind_job=0 45 8 * * ? *
health_upload_weishangbao_remind_job=0 45 8 * * ? *
health_upload_total_remind_job=0 0 9 * * ? *