Browse Source

Merge remote-tracking branch 'origin/dev' into dev

LAPTOP-KB9HII50\70708 2 years ago
parent
commit
9afa184cbe
24 changed files with 1368 additions and 81 deletions
  1. 317 30
      business/base-service/src/main/java/com/yihu/jw/healthUpload/service/BaseDoctorHealthUploadService.java
  2. 27 9
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 64 0
      business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java
  4. 1 0
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  5. 1 3
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  6. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  7. 11 0
      gateway/ag-basic/src/main/resources/application.yml
  8. 9 1
      gateway/ag-basic/src/main/resources/bootstrap.yml
  9. 248 18
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  10. 35 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/YkyyService.java
  11. 29 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadRemindMessageJob.java
  12. 29 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadSecondRemindMessageJob.java
  13. 29 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadTotalRemindMessageJob.java
  14. 29 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/HealthUploadWeishangbaoRemindMessageJob.java
  15. 314 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/HealthUploadService.java
  16. 13 5
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java
  17. 9 5
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java
  18. 82 6
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  19. 40 1
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  20. 8 1
      svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml
  21. 11 1
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  22. 11 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  23. 40 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java
  24. 1 1
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml

+ 317 - 30
business/base-service/src/main/java/com/yihu/jw/healthUpload/service/BaseDoctorHealthUploadService.java

@ -1,4 +1,5 @@
package com.yihu.jw.healthUpload.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sun.org.apache.bcel.internal.generic.NEW;
@ -16,9 +17,11 @@ import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.healthUpload.BaseDoctorHealthUploadDO;
import com.yihu.jw.entity.healthUpload.BaseDoctorMemberDO;
import com.yihu.jw.entity.hospital.DmHospitalDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.BaseDeptDict;
import com.yihu.jw.healthUpload.dao.BaseDoctorHealthUploadDao;
import com.yihu.jw.healthUpload.dao.BaseDoctorMemberDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.common.PwdUtil;
@ -78,6 +81,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
    private HibenateUtils hibenateUtils;
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    /**
     * 新增医生成员关系
@ -201,36 +206,94 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                for (BaseDoctorRoleDO roleDO : roleDOS) {
                    BaseDoctorDO doctorDO = baseDoctorDao.findById(roleDO.getDoctorCode());
                    if (doctorDO != null) {
                        if (!StringUtils.isNoneBlank(doctorDO.getOpenid())) {
                            logger.info("该用户" + doctorDO.getName() + "没有openid,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:xm_mlwyy_wx");
                        } else {
                            WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus("xm_mlwyy_wx", "template_unusual_notice", "jkzlyctxtz", 1);
                            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                            BeanUtils.copyProperties(config, newConfig);
                            if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
                                newConfig.setFirst(config.getFirst().replace("key1", doctorHospitalDOS.get(0).getDeptName()).replace("key2", baseDoctorHealthUploadDO.getDoctorName()));
                        WlyyHospitalSysDictDO hospitalSysDictDO  = hospitalSysDictDao.findById("isYichangRemind");
                        if (hospitalSysDictDO!=null){
                            String value = hospitalSysDictDO.getDictValue();
                            if (StringUtils.isNoneBlank(value)){
                                JSONObject object = JSONObject.parseObject(value);
                                String close = object.getString("close");
                                String time = object.getString("time");
                                String count =object.getString("count");
                                if (!close.equalsIgnoreCase("1")){
                                    String startEnd = DateUtil.getPreTime(DateUtil.getStringDate(),time);
                                    String sql = "select count(1) as total from wx_push_log where create_time >='"+startEnd+"' ";
                                    Map<String,Object> map = jdbcTemplate.queryForMap(sql);
                                    Integer total = 0;
                                    if (map!=null){
                                        if (map.get("total")!=null){
                                            total = Integer.parseInt(map.get("total").toString());
                                        }
                                    }
                                    logger.info("startEnd:"+startEnd+total);
                                    if (StringUtils.isNoneBlank(count)){
                                        if (total<Integer.parseInt(count)){
                                            if (!StringUtils.isNoneBlank(doctorDO.getOpenid())) {
                                                logger.info("该用户" + doctorDO.getName() + "没有openid,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:xm_mlwyy_wx");
                                            } else {
                                                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus("xm_mlwyy_wx", "template_unusual_notice", "jkzlyctxtz", 1);
                                                WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                                                BeanUtils.copyProperties(config, newConfig);
                                                if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
                                                    newConfig.setFirst(config.getFirst().replace("key1", doctorHospitalDOS.get(0).getDeptName()).replace("key2", baseDoctorHealthUploadDO.getDoctorName()));
                                                } else {
                                                    newConfig.setFirst(config.getFirst().replace("key1的", "").replace("key2", baseDoctorHealthUploadDO.getDoctorName()));
                                                }
                                                newConfig.setKeyword2(baseDoctorHealthUploadDO.getDoctorName());
                                                newConfig.setKeyword3(DateUtil.getStringDate());
                                                newConfig.setUrl("https://ehr.yihu.com/hlwyy/healthMonitoring/#/health/commit?id=" + baseDoctorHealthUploadDO.getId() + "&docCode=" + baseDoctorHealthUploadDO.getDoctorId() + "");
                                                WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById("xm_mlwyy_wx");
                                                logger.info("=======setUrl========" + newConfig.getUrl());
                                                weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), doctorDO.getOpenid(), newConfig);
                                            }
                                            //保存发送模板记录,
                                            WxPushLogDO wxPushLogDO = new WxPushLogDO();
                                            wxPushLogDO.setCreateTime(new Date());
                                            wxPushLogDO.setOpenid(doctorDO.getOpenid());
                                            wxPushLogDO.setReceiver(doctorDO.getId());
                                            wxPushLogDO.setWechatId("xm_mlwyy_wx");
                                            wxPushLogDO.setReceiverName(doctorDO.getName());
                                            wxPushLogDO.setScene("jkzlyctxtz");
                                            wxPushLogDao.save(wxPushLogDO);
                                        }
                                    }
                                }
                            }
                        }else {
                            if (!StringUtils.isNoneBlank(doctorDO.getOpenid())) {
                                logger.info("该用户" + doctorDO.getName() + "没有openid,无法推送模版消息,用户ID:" + doctorDO.getId() + "wechatId:xm_mlwyy_wx");
                            } else {
                                newConfig.setFirst(config.getFirst().replace("key1的", "").replace("key2", baseDoctorHealthUploadDO.getDoctorName()));
                                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus("xm_mlwyy_wx", "template_unusual_notice", "jkzlyctxtz", 1);
                                WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                                BeanUtils.copyProperties(config, newConfig);
                                if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
                                    newConfig.setFirst(config.getFirst().replace("key1", doctorHospitalDOS.get(0).getDeptName()).replace("key2", baseDoctorHealthUploadDO.getDoctorName()));
                                } else {
                                    newConfig.setFirst(config.getFirst().replace("key1的", "").replace("key2", baseDoctorHealthUploadDO.getDoctorName()));
                                }
                                newConfig.setKeyword2(baseDoctorHealthUploadDO.getDoctorName());
                                newConfig.setKeyword3(DateUtil.getStringDate());
                                newConfig.setUrl("https://ehr.yihu.com/hlwyy/healthMonitoring/#/health/commit?id=" + baseDoctorHealthUploadDO.getId() + "&docCode=" + baseDoctorHealthUploadDO.getDoctorId() + "");
                                WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById("xm_mlwyy_wx");
                                logger.info("=======setUrl========" + newConfig.getUrl());
                                weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), doctorDO.getOpenid(), newConfig);
                            }
                            newConfig.setKeyword2(baseDoctorHealthUploadDO.getDoctorName());
                            newConfig.setKeyword3(DateUtil.getStringDate());
                            newConfig.setUrl("https://ehr.yihu.com/hlwyy/healthMonitoring/#/health/commit?id=" + baseDoctorHealthUploadDO.getId() + "&docCode=" + baseDoctorHealthUploadDO.getDoctorId() + "");
                            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById("xm_mlwyy_wx");
                            logger.info("=======setUrl========" + newConfig.getUrl());
                            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), doctorDO.getOpenid(), newConfig);
                            //保存发送模板记录,
                            WxPushLogDO wxPushLogDO = new WxPushLogDO();
                            wxPushLogDO.setCreateTime(new Date());
                            wxPushLogDO.setOpenid(doctorDO.getOpenid());
                            wxPushLogDO.setReceiver(doctorDO.getId());
                            wxPushLogDO.setWechatId("xm_mlwyy_wx");
                            wxPushLogDO.setReceiverName(doctorDO.getName());
                            wxPushLogDO.setScene("jkzlyctxtz");
                            wxPushLogDao.save(wxPushLogDO);
                        }
                        //保存发送模板记录,
                        WxPushLogDO wxPushLogDO = new WxPushLogDO();
                        wxPushLogDO.setCreateTime(new Date());
                        wxPushLogDO.setOpenid(doctorDO.getOpenid());
                        wxPushLogDO.setReceiver(doctorDO.getId());
                        wxPushLogDO.setWechatId("xm_mlwyy_wx");
                        wxPushLogDO.setReceiverName(doctorDO.getName());
                        wxPushLogDO.setScene("jkzlyctxtz");
                        wxPushLogDao.save(wxPushLogDO);
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
@ -414,14 +477,24 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            //今日上报人次
            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' ";
            //今日异常人次
            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)";
            yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from ( SELECT\n" +
                    "\td3.*\n" +
                    "FROM\n" +
                    "\t( SELECT *,MAX(d1.create_time) as createTime FROM base_doctor_health_upload d1 GROUP BY\n" +
                    "\td1.doctor_id ) d2\n" +
                    "LEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id=d3.doctor_id AND  d2.createTime = d3.create_time  ) 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)";
        } else if (level == 2) {
            //总人次
            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 )";
            //今日上报人次
            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'";
            //今日异常人次
            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)";
            yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from ( SELECT\n" +
                    "\td3.*\n" +
                    "FROM\n" +
                    "\t( SELECT *,MAX(d1.create_time) as createTime FROM base_doctor_health_upload d1 GROUP BY\n" +
                    "\td1.doctor_id ) d2\n" +
                    "LEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id=d3.doctor_id AND  d2.createTime = d3.create_time  ) 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)";
        }
        //今日提交
        int personTotal = 0;
@ -670,7 +743,137 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
     * @return
     */
    public List<Map<String, Object>> selectHeaderList(String dept, String idType, String status, String state, String startDate, String endDate, String name) {
        String deptSql = " select code,name from dict_hospital_dept hd where hd.consult_dept_flag=1 ";
        String condition = "";
        if (StringUtils.isNoneBlank(startDate)) {
            condition += " and d.create_time >='" + startDate + " 00:00:00' and d.create_time<='" + endDate + " 23:59:59' ";
        }
        String doctorSql = "";
        if (StringUtils.isNoneBlank(idType)) {
            doctorSql += " and d.id_type = '" + idType + "' ";
        }
        if (StringUtils.isNoneBlank(name)) {
            doctorSql += " and d.name like '%" + name + "%' ";
        }
        String sql = "";
        if (StringUtils.isNoneBlank(state)) {
            if (state.equalsIgnoreCase("1")) {
                sql += " and (d.health_code not in(2,3) and CAST(d.temperature as DECIMAL)<37.3 and  d.is_symptoms=2 and d.is_epidemic=2) ";
            } else if (state.equalsIgnoreCase("2")) {
                sql += " 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) ";
            }
        }
        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(idTypeCondition)) {
            sql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            sql += " and d.doctor_name like '%" + name + "%'";
        }
        String ycandzcSql = "";
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            ycandzcSql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            ycandzcSql += " and d.doctor_name like '%" + name + "%'";
        }
        String deptSql = "SELECT\n" +
                "\tcode,\n" +
                "\tname,\n" +
                "\tdh1.total,\n" +
                "\tdh2.total as yishangbaoTotal,\n" +
                "\tdh3.total as shangchuanTotal,\n" +
                "\tdh4.total as zhengchangTotal,\n" +
                "\tdh5.total as yichangTotal,\n" +
                "\tdh6.total as yichangPersonTotal\n" +
                "FROM\n" +
                "\tdict_hospital_dept hd\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tdh.dept_code,\n" +
                "\t\tCOUNT(1) AS \"total\"\n" +
                "\tFROM\n" +
                "\t\tbase_doctor d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.id\n" +
                "\tWHERE\n" +
                "\t\td.del = 1\n" +
                "\tAND dh.del = 1\n" +
                doctorSql+
                "\tGROUP BY\n" +
                "\t\tdh.dept_code\n" +
                ") dh1 ON hd. CODE = dh1.dept_code\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tdh.dept_code,\n" +
                "\t\tCOUNT(DISTINCT d.doctor_id) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
              condition+ sql+
                "\tGROUP BY\n" +
                "\t\tdh.dept_code\n" +
                ")dh2 ON dh2.dept_code=hd.code\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tdh.dept_code,\n" +
                "\t\tCOUNT(1) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                condition+ sql+
                "\tGROUP BY\n" +
                "\t\tdh.dept_code\n" +
                ")dh3 ON dh3.dept_code=hd.code\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tdh.dept_code,\n" +
                "\t\tCOUNT(1) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                "\tand (d.health_code not in(2,3) AND CAST(d.temperature as DECIMAL)<37.3 AND  d.is_symptoms=2 and  d.is_epidemic=2)\n" +
                condition+ycandzcSql+
                "\tGROUP BY\n" +
                "\t\tdh.dept_code\n" +
                ")dh4 ON dh4.dept_code=hd.code\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tdh.dept_code,\n" +
                "\t\tCOUNT(1) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                "\tand (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)\n" +
                condition+ycandzcSql+
                "\tGROUP BY\n" +
                "\t\tdh.dept_code\n" +
                ")dh5 ON dh5.dept_code=hd.code\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tdh.dept_code,\n" +
                "\t\tCOUNT(DISTINCT d.doctor_id) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                "\tand (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)\n" +
                condition+ycandzcSql+
                "\tGROUP BY\n" +
                "\t\tdh.dept_code\n" +
                ")dh6 ON dh6.dept_code=hd.code\n" +
                "WHERE\n" +
                "\thd.consult_dept_flag = 1 ";
        if (StringUtils.isNoneBlank(name)) {
            deptSql += " and hd.code IN(SELECT dha.dept_code FROM base_doctor_hospital dha LEFT JOIN base_doctor da ON da.id=dha.doctor_code where da.name LIKE '%" + name + "%') ";
        }
@ -678,6 +881,62 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            deptSql += " and hd.code = '" + dept + "' ";
        }
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(deptSql);
        for (Map<String,Object> deptMap:mapList){
            String day = DateUtil.getTwoDay(endDate, startDate);
            Integer total = 0;
            Integer yishangbaoTotal = 0;
            Integer weishangbaoTotal = 0;
            Integer zhengchangTotal = 0;
            Integer yichangTotal = 0;
            Integer shangchuanTotal = 0;
            Integer yichangPersonTotal = 0;
            if (deptMap.get("total")!=null){
                String doctorTotal = deptMap.get("total").toString();
                //总人次
                if (!day.equalsIgnoreCase("0")) {
                    total = Integer.parseInt(doctorTotal) * Integer.parseInt(day);
                } else {
                    total = Integer.parseInt(doctorTotal);
                }
            }
            if (deptMap.get("yishangbaoTotal")!=null){
                yishangbaoTotal = Integer.parseInt(deptMap.get("yishangbaoTotal").toString());
            }
            //未上报
            weishangbaoTotal = total - yishangbaoTotal;
            if (deptMap.get("zhengchangTotal")!=null){
                zhengchangTotal = Integer.parseInt(deptMap.get("zhengchangTotal").toString());
            }
            if (deptMap.get("yichangTotal")!=null){
                yichangTotal = Integer.parseInt(deptMap.get("yichangTotal").toString());
            }
            if (deptMap.get("yichangPersonTotal")!=null){
                yichangPersonTotal = Integer.parseInt(deptMap.get("yichangPersonTotal").toString());
            }
            if (deptMap.get("shangchuanTotal")!=null){
                shangchuanTotal = Integer.parseInt(deptMap.get("shangchuanTotal").toString());
            }
            JSONObject object = new JSONObject();
            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);
        }
        /*  String deptSql = " select code,name from dict_hospital_dept hd where hd.consult_dept_flag=1 ";
        if (StringUtils.isNoneBlank(name)) {
            deptSql += " and hd.code IN(SELECT dha.dept_code FROM base_doctor_hospital dha LEFT JOIN base_doctor da ON da.id=dha.doctor_code where da.name LIKE '%" + name + "%') ";
        }
        if (StringUtils.isNoneBlank(dept)) {
            deptSql += " and hd.code = '" + dept + "' ";
        }*/
       /* List<Map<String, Object>> mapList = jdbcTemplate.queryForList(deptSql);
        for (Map<String, Object> deptmap : mapList) {
            String deptCode = deptmap.get("code").toString();
            JSONObject object = new JSONObject();
@ -810,21 +1069,49 @@ 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 (SELECT\n" +
                    "\td3.*\n" +
                    "FROM\n" +
                    "\t( SELECT *,MAX(d1.create_time) as createTime FROM base_doctor_health_upload d1 GROUP BY\n" +
                    "\td1.doctor_id ) d2\n" +
                    "LEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id=d3.doctor_id AND  d2.createTime = d3.create_time  ) 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);
        }
        }*/
        return mapList;
    }

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

@ -140,6 +140,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.Null;
import java.beans.Transient;
import java.io.IOException;
import java.io.OutputStream;
@ -303,16 +304,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private BaseJobCategoryDao jobCategoryDao;
    @Autowired
    private BaseSmsTemplateDao smsTemplateDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private BaseJpushTemplateDao baseJpushTemplateDao;
    /*@Autowired
    HikariDataSource dataSource;*/
    @Autowired
    private BaseSensitiveDao baseSensitiveDao;
    @Autowired
@ -332,8 +330,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    @Autowired
    private YlzMedicailMxDao ylzMedicailMxDao;
    @Autowired
    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao;
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
    @Autowired
    private HcyyEntranceService hcyyEntranceService;
@ -3390,6 +3386,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " e.oneself_pickup_flg AS \"oneselfPickupFlg\", " +
                " o.id AS \"outpatientId\", " +
                " o.icd10_name AS \"icd10Name\", " +
                " o.medical_state AS \"medicalState\", " +
                " p.status as \"status\", " +
                " p.id AS \"prescriptionId\" ," +
                " e.id AS \"expressageId\" ," +
@ -3555,6 +3552,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " e.oneself_pickup_flg AS \"oneselfPickupFlg\", " +
                " o.id AS \"outpatientId\", " +
                " o.icd10_name AS \"icd10Name\", " +
                " o.medical_state AS \"medicalState\", " +
                " p.status as \"status\", " +
                " p.id AS \"prescriptionId\" ," +
                " e.id AS \"expressageId\" ,"+
@ -3634,7 +3632,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"订单日期", "处方编号", "就诊人姓名", "收货人", "订单药品", "配送方式", "支付时间", "是否开方", "订单状态"};//"订单日期", "收货人", "诊断结果", "配送方式", "订单状态"
            String[] header = {"订单日期", "处方编号", "就诊人姓名", "收货人", "订单药品", "配送方式", "支付时间", "是否开方", "订单状态","是否医保"};//"订单日期", "收货人", "诊断结果", "配送方式", "订单状态"
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
@ -3651,7 +3649,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }else {
                    createTime = "是";
                }
                String medicalStateName = "";
                if (m.get("medicalState") == null) {
                    medicalStateName = "否";
                }else {
                    String medicalState = m.get("medicalState").toString();
                    if (medicalState.equalsIgnoreCase("1")){
                        medicalStateName = "是";
                    }else {
                        medicalStateName = "否";
                    }
                }
                String opf = "";
                if (m.get("oneselfPickupFlg") == null) {
                    opf = null;
@ -3715,6 +3723,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                addCell(ws, i, 6, m.get("payTime")!=null?m.get("payTime").toString():n);
                addCell(ws, i, 7, createTime!=null?createTime:n);
                addCell(ws, i, 8, status!=null?status:n);
                addCell(ws, i, 9, medicalStateName!=null?medicalStateName:n);
                i++;
            }
            wwb.write();
@ -14906,7 +14915,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    /**
     * 药品明细表导出
     * @param osmergeCells(a,b,c,d)
     *
     * @param ls
     * @param startTime
     * @param endTime
@ -15136,4 +15145,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            return envelop;
        }
    }
    public String getDoctorAppointDate(String doctorId){
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
        if (doctorDO!= null){
            String res = ykyyService.get_app_date(doctorDO.getYktCode(),"0");
            return res;
        }
        return null;
    }
}

+ 64 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java

@ -13,10 +13,13 @@ import com.yihu.jw.util.common.StringUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.common.utils.DateUtils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -906,4 +909,65 @@ public class YkyyService {
        logger.info("获取门诊结算信息:"+response);
        return response;
    }
    public static String key = "HXYKT123!@#";
    /**
     * 根据手机号码获取医生密码
     * @param mobile 手机号
     * @return
     */
    public String getDoctorPhone(String mobile){
        String response="";
        long timespan = System.currentTimeMillis();
        String sceret = MD5.md5Hex(mobile+timespan+key);
        String url=yktUrl+"doctor/get_doctor_pwd_by_tel?tel="+mobile+"&timespan="+timespan+"&token="+sceret;
        logger.info("根据手机号码获取医生密码="+url);
        response = httpClientUtil.get(url,"UTF-8");
        logger.info("根据手机号码获取医生密码"+response);
        return response;
    }
    /**
     * 根据手机号码获取患者密码
     * @param mobile 手机号
     * @return
     */
    public String getPatientPhone(String mobile){
        String response="";
        long timespan = System.currentTimeMillis();
        String sceret = MD5.md5Hex(mobile+timespan+key);
        String url=yktUrl+"patient/get_patient_pwd_by_tel?tel="+mobile+"&timespan="+timespan+"&token="+sceret;
        logger.info("根据手机号码获取患者密码="+url);
        response = httpClientUtil.get(url,"UTF-8");
        logger.info("根据手机号码获取患者密码"+response);
        return response;
    }
    /**
     * 获取可预约日期列表
     *
     * @param DocCode 医生代码,传值类似82468
     * @param hospital_type 医院(0:思北 1:五缘)
     * @return
     */
    public String get_app_date(String DocCode,String hospital_type){
        String response="";
        JSONObject object = new JSONObject();
        object.put("DocCode",DocCode);
        object.put("hospital_type",hospital_type);
        long timespan = System.currentTimeMillis();
        String sign = MD5.md5Hex(object.toJSONString()+timespan+"HxYkt123");
        String params = Base64.encodeBase64String(object.toJSONString().getBytes());
        String url=yktUrl+"appointment_doctor_new/get_app_date?Params="+params+"&Timestamp="+timespan+"&Sign="+sign+"";
        logger.info("获取可预约日期列表="+url);
        response = httpClientUtil.get(url,"UTF-8");
        logger.info("获取可预约日期列表"+response);
        return response;
    }
}

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

@ -4076,6 +4076,7 @@ public class ImService {
                "op.doctor as \"doctor\" ," +
                "op.source as \"source\"  ," +
                "op.card_no as \"cardNo\"  ," +
                "op.medical_state as \"medicalState\"  ," +
                "op.patient_cancel_value as \"patientCancelValue\" ," +
                "op.patient_cancel_remark as \"patient_cancel_remark\"  " +
                "FROM wlyy_outpatient op LEFT JOIN wlyy_consult a  ON a.relation_code = op.id \n" +

+ 1 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,9 +25,7 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
/*
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
*/
/*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

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

@ -306,6 +306,16 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    private Integer mark;//数据导出权限   1是 0否
    private String yktCode;//眼科通医生编码
    public String getYktCode() {
        return yktCode;
    }
    public void setYktCode(String yktCode) {
        this.yktCode = yktCode;
    }
    public Integer getMark() {
        return mark;
    }

+ 11 - 0
gateway/ag-basic/src/main/resources/application.yml

@ -349,3 +349,14 @@ spring:
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
---
spring:
  profiles: jwZnygProdIn
  datasource:
     url: jdbc:mysql://10.95.22.191:3406/medicine?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     username: wlyy
     password: qY#j2n5O
  redis:
     host: 10.95.22.142
     port: 6380
     password: jkzlehr

+ 9 - 1
gateway/ag-basic/src/main/resources/bootstrap.yml

@ -185,4 +185,12 @@ spring:
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: jwZnygProdIn
  cloud:
    config:
      uri: ${wlyy-spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy-spring.config.label:jwdev}

+ 248 - 18
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -1,5 +1,6 @@
package com.yihu.jw.security.oauth2.provider.endpoint;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.impl.DefaultKaptcha;
@ -2414,16 +2415,19 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        if (wlyyHospitalSysDictDO!=null){
            isNeedGeet=wlyyHospitalSysDictDO.getDictValue();
        }
        if ("1".equalsIgnoreCase(isNeedGeet)){
            String geetestChallenge = parameters.get("geetestChallenge");
            String geetestValidate = parameters.get("geetestValidate");
            String geetestSeccode = parameters.get("geetestSeccode");
        JSONObject resResult =validateGeet(geetestChallenge,geetestValidate,geetestSeccode,"1");
        if (resResult==null||!resResult.getString("result").equalsIgnoreCase("success")){
            throw new  Exception("验证失败");
        }
        if (parameters.get("mobile")==null){
            if ("1".equalsIgnoreCase(isNeedGeet)){
                String geetestChallenge = parameters.get("geetestChallenge");
                String geetestValidate = parameters.get("geetestValidate");
                String geetestSeccode = parameters.get("geetestSeccode");
                JSONObject resResult =validateGeet(geetestChallenge,geetestValidate,geetestSeccode,"1");
                if (resResult==null||!resResult.getString("result").equalsIgnoreCase("success")){
                    throw new  Exception("验证失败");
                }
            }
        }
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
@ -2451,7 +2455,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                if (!StringUtils.isEmpty(response)){
                    JSONObject object = JSONObject.parseObject(response);
                    if (!object.getString("code").equalsIgnoreCase("200")){
                        throw new Exception(object.getString("msg"));
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("msg"),-1,userSimple);
                    }else {
                        JSONObject jsonObject = object.getJSONObject("data");
                        if (jsonObject!=null){
@ -2607,7 +2612,182 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                    }
                }
                parameters.remove("password");
            } else if (!StringUtils.isEmpty(loginType)&&"3".equalsIgnoreCase(loginType)){
            }else if (parameters.get("mobile") != null) {
                KeyPair keyPair = (KeyPair) httpSession.getAttribute("privateKey");
                String mobile = com.yihu.jw.security.utils.RSAUtils.decryptBase64(parameters.get("mobile"), keyPair);
                logger.info("mobile:"+mobile);
                String password = null;
                String res = ykyyService.getPatientPhone(mobile);
                if (res!=null&&res!=""){
                    JSONObject object = JSONObject.parseObject(res);
                    if (object.getString("code").equalsIgnoreCase("200")){
                        password = object.getString("data");
                    }else {
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("msg"),-1,userSimple);
                    }
                }
                    String response = ykyyService.yktLogin(parameters.get("username"),password);
                    if (!StringUtils.isEmpty(response)){
                        JSONObject object = JSONObject.parseObject(response);
                        if (!object.getString("code").equalsIgnoreCase("200")){
                            throw new Exception(object.getString("msg"));
                        }else {
                            JSONObject jsonObject = object.getJSONObject("data");
                            if (jsonObject!=null){
                                String userId= jsonObject.getString("ID");
                                String tel = jsonObject.getString("LOGINID");
                                List<BasePatientDO> basePatientDOS = basePatientDao.findByMobile(tel);
                                if (basePatientDOS==null||basePatientDOS.size()==0){
                                    BasePatientDO basePatientDO = new BasePatientDO();
                                    String familyList = ykyyService.getFamilyList(null,userId);
                                    JSONObject familyJson = JSONObject.parseObject(familyList);
                                    if (familyJson.getString("code").equalsIgnoreCase("200")){
                                        JSONObject object1 = familyJson.getJSONObject("data");
                                        JSONArray list = object1.getJSONArray("list");
                                        List<String> iliness = new ArrayList<>();
                                        if (list!=null&&list.size()!=0){
                                            for (int i=0;i<list.size();i++){
                                                JSONObject family = list.getJSONObject(i);
                                                iliness.add(family.getString("ILLNESS"));
                                                if (family.getString("ILLNESS").equalsIgnoreCase("本人")&&tel.equalsIgnoreCase(family.getString("TEL"))){
                                                    basePatientDO.setDel("1");
                                                    basePatientDO.setName(family.getString("NAME"));
                                                    basePatientDO.setCreateTime(new Date());
                                                    basePatientDO.setUpdateTime(new Date());
                                                    basePatientDO.setYktId(family.getString("ID"));
                                                    basePatientDO.setUserId(userId);
                                                    basePatientDO.setIdcard(family.getString("IDCARD"));
                                                    String idcard = family.getString("IDCARD");
                                                    Integer age = IdCardUtil.getAgeForIdcard(idcard);
                                                    String sex = IdCardUtil.getSexForIdcard_new(idcard);
                                                    Integer sexx = null;
                                                    if (org.apache.commons.lang3.StringUtils.isNoneBlank(sex)){
                                                        sexx = Integer.parseInt(sex);
                                                    }
                                                    String birthDay = family.getString("BIRTHDAY");
                                                    Date birthday = null;
                                                    if (org.apache.commons.lang3.StringUtils.isNoneBlank(birthDay)){
                                                        birthday = DateUtil.strToDate(birthDay+" 00:00:00");;
                                                    }
                                                    basePatientDO.setBirthday(birthday);
                                                    basePatientDO.setSex(sexx);
                                                    basePatientDO.setMobile(tel);
                                                    String salt = UUID.randomUUID().toString().substring(0,5);
                                                    String pw = idcard.substring(idcard.length()-6,idcard.length());
                                                    basePatientDO.setIdcard(idcard);
                                                    basePatientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                                    basePatientDO.setSalt(salt);
                                                    basePatientDO.setLocked(0);
                                                    basePatientDO.setEnabled(1);
                                                    basePatientDO.setVerifyCode(jsonObject.getString("TOKEN"));
                                                    basePatientDO.setPatientStatus("1");
                                                    basePatientDao.save(basePatientDO);
                                                }else {
                                                    List<BasePatientDO> basePatientDOList = basePatientDao.findByMobile(tel);
                                                    if(basePatientDOList==null||basePatientDOList.size()==0){
                                                        basePatientDO.setDel("1");
                                                        if (jsonObject.getString("USERNAME").length()>=2){
                                                            basePatientDO.setName(jsonObject.getString("USERNAME"));
                                                        }else {
                                                            basePatientDO.setName(tel);
                                                        }
                                                        basePatientDO.setCreateTime(new Date());
                                                        basePatientDO.setUpdateTime(new Date());
                                                        basePatientDO.setYktId(jsonObject.getString("ID"));
                                                        basePatientDO.setUserId(userId);
                                                        basePatientDO.setMobile(tel);
                                                        String salt = UUID.randomUUID().toString().substring(0,5);
                                                        String pw = tel.substring(tel.length()-6,tel.length());
                                                        basePatientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                                        basePatientDO.setSalt(salt);
                                                        basePatientDO.setLocked(0);
                                                        basePatientDO.setEnabled(1);
                                                        basePatientDO.setPatientStatus("1");
                                                        basePatientDao.save(basePatientDO);
                                                    }
                                                }
                                            }
                                        }else {
                                            if (jsonObject.getString("USERNAME").length()>=2){
                                                basePatientDO.setName(jsonObject.getString("USERNAME"));
                                            }else {
                                                basePatientDO.setName(tel);
                                            }
                                            basePatientDO.setDel("1");
                                            basePatientDO.setCreateTime(new Date());
                                            basePatientDO.setUpdateTime(new Date());
                                            basePatientDO.setUserId(userId);
                                            basePatientDO.setMobile(tel);
                                            String salt = UUID.randomUUID().toString().substring(0,5);
                                            String pw = tel.substring(tel.length()-6,tel.length());
                                            basePatientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                            basePatientDO.setSalt(salt);
                                            basePatientDO.setLocked(0);
                                            basePatientDO.setEnabled(1);
                                            basePatientDO.setPatientStatus("1");
                                            basePatientDao.save(basePatientDO);
                                        }
                                    /*String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO.getIdcard());
                                    Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard());
                                    Integer sex = basePatientDO.getSex()!=null?basePatientDO.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
                                        if (!iliness.contains("本人")){
                                            ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                    }*/
                                    }
                                }else {
                                    logger.info("======"+jsonObject.getString("USERNAME")+"======");
                                    logger.info("tel"+jsonObject.getString("USERNAME"));
                                    BasePatientDO basePatientDO1 = basePatientDOS.get(0);
                                    if (basePatientDO1.getName()==null||basePatientDO1.getName()==""){
                                        if (jsonObject.getString("USERNAME").length()>=2){
                                            basePatientDO1.setName(jsonObject.getString("USERNAME"));
                                        }else {
                                            basePatientDO1.setName(tel);
                                        }
                                    }
                                    basePatientDO1.setVerifyCode(jsonObject.getString("TOKEN"));
                                    basePatientDO1.setUserId(userId);
                                    basePatientDao.save(basePatientDO1);
                                /*String familyList = ykyyService.getFamilyList(null,userId);
                                JSONObject familyJson = JSONObject.parseObject(familyList);
                                if (familyJson.getString("code").equalsIgnoreCase("200")){
                                    JSONObject object1 = familyJson.getJSONObject("data");
                                    JSONArray list = object1.getJSONArray("list");
                                    List<String> iliness = new ArrayList<>();
                                    if (list!=null&&list.size()!=0){
                                        for (int i=0;i<list.size();i++) {
                                            JSONObject family = list.getJSONObject(i);
                                            iliness.add(family.getString("ILLNESS"));
                                        }
                                    }
                                    String birdth = null;
                                    Integer age = 0;
                                    if (org.apache.commons.lang3.StringUtils.isNoneBlank(basePatientDO1.getIdcard())){
                                        birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO1.getIdcard());
                                        age =com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO1.getIdcard());
                                    }
                                    Integer sex = basePatientDO1.getSex()!=null?basePatientDO1.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
                                        if (!iliness.contains("本人")){
                                            ykyyService.addFamily(basePatientDO1.getUserId(),basePatientDO1.getIdcard(),basePatientDO1.getName(),sex+"",birdth,age+"",basePatientDO1.getMobile());
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO1.getUserId(),basePatientDO1.getIdcard(),basePatientDO1.getName(),sex+"",birdth,age+"",basePatientDO1.getMobile());
                                    }
                                }*/
                                }
                            }
                        }
                    }
                    parameters.remove("password");
                } else if (!StringUtils.isEmpty(loginType)&&"3".equalsIgnoreCase(loginType)){
                if (wlyyRedisVerifyCodeService.verification(client_id, username, captcha)) {
                    //验证码正确
                }
@ -2775,13 +2955,15 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        if (wlyyHospitalSysDictDO1!=null){
            isNeedGeet=wlyyHospitalSysDictDO1.getDictValue();
        }
        if("1".equalsIgnoreCase(isNeedGeet)){
            String geetestChallenge = parameters.get("geetestChallenge");
            String geetestValidate = parameters.get("geetestValidate");
            String geetestSeccode = parameters.get("geetestSeccode");
            JSONObject resResult =validateGeet(geetestChallenge,geetestValidate,geetestSeccode,"2");
            if (resResult==null||!resResult.getString("result").equalsIgnoreCase("success")){
                throw new  Exception("验证失败");
        if (parameters.get("mobile")==null){
            if("1".equalsIgnoreCase(isNeedGeet)){
                String geetestChallenge = parameters.get("geetestChallenge");
                String geetestValidate = parameters.get("geetestValidate");
                String geetestSeccode = parameters.get("geetestSeccode");
                JSONObject resResult =validateGeet(geetestChallenge,geetestValidate,geetestSeccode,"2");
                if (resResult==null||!resResult.getString("result").equalsIgnoreCase("success")){
                    throw new  Exception("验证失败");
                }
            }
        }
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
@ -2818,6 +3000,53 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                String password = com.yihu.jw.security.utils.RSAUtils.decryptBase64(parameters.get("password"), keyPair);
                logger.info("password:"+password);
                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
                if (!StringUtils.isEmpty(response)){
                    JSONObject object = JSONObject.parseObject(response);
                    logger.info("眼科通登陆返回参数:"+object);
                    if (!object.getString("code").equalsIgnoreCase("10000")){
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("msg"),-1,userSimple);
                    }else {
                        JSONObject jsonObject = object.getJSONObject("value");
                        if (jsonObject!=null) {
                            String idCard = jsonObject.getString("idCard");
                            String verifyCode = jsonObject.getString("verifyCode");
                            String yktDoctorId= jsonObject.getString("id");
                            BaseDoctorDO doctorDOs = doctorDao.findByIdcard(idCard);
                            if (doctorDOs!=null){
                                doctorDOs.setVerifyCode(verifyCode);
                                doctorDOs.setYktDoctorId(yktDoctorId);
                                /*doctorDOs.setYktCode();*/
                                doctorDao.save(doctorDOs);
                            }else {
                                WlyyUserSimple userSimple = new WlyyUserSimple();
                                return getFailedResponse("您的账号未认证,请联系互联网医院工作人员,联系电话0592-2108763。",-1,userSimple);
                            }
                            if (idCard==null||idCard==""){
                                logger.info("身份证为空");
                            }else {
                                ykyyService.updateYkyyDoctor(idCard,verifyCode,yktDoctorId);
                            }
                        }
                    }
                }
                parameters.remove("password");
            } else if (parameters.get("mobile") != null) {
                KeyPair keyPair = (KeyPair) httpSession.getAttribute("privateKey");
                String mobile = com.yihu.jw.security.utils.RSAUtils.decryptBase64(parameters.get("mobile"), keyPair);
                logger.info("mobile:"+mobile);
                String password = null;
                String res = ykyyService.getDoctorPhone(mobile);
                if (res!=null&&res!=""){
                    JSONObject object = JSONObject.parseObject(res);
                    if (object.getString("code").equalsIgnoreCase("200")){
                        password = object.getString("data");
                    }else {
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("msg"),-1,userSimple);
                    }
                }
                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
                if (!StringUtils.isEmpty(response)){
                    JSONObject object = JSONObject.parseObject(response);
                    logger.info("眼科通登陆返回参数:"+object);
@ -2834,6 +3063,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                            if (doctorDOs!=null){
                                doctorDOs.setVerifyCode(verifyCode);
                                doctorDOs.setYktDoctorId(yktDoctorId);
                                /*doctorDOs.setYktCode();*/
                                doctorDao.save(doctorDOs);
                            }else {
                                WlyyUserSimple userSimple = new WlyyUserSimple();
@ -2848,7 +3078,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                    }
                }
                parameters.remove("password");
            } else {
            }else {
                //第三方同步账号模式登录
                parameters.put("grant_type", "ihealthDcotor");
            }

+ 35 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/YkyyService.java

@ -631,4 +631,39 @@ public class YkyyService {
        return "success";
    }
    public static String key = "HXYKT123!@#";
    /**
     * 根据手机号码获取医生密码
     * @param mobile 手机号
     * @return
     */
    public String getDoctorPhone(String mobile){
        String response="";
        long timespan = System.currentTimeMillis();
        String sceret = MD5.md5Hex(mobile+timespan+key);
        String url=yktUrl+"doctor/get_doctor_pwd_by_tel?tel="+mobile+"&timespan="+timespan+"&token="+sceret;
        logger.info("根据手机号码获取医生密码="+url);
        response = httpClientUtil.get(url,"UTF-8");
        logger.info("根据手机号码获取医生密码"+response);
        return response;
    }
    /**
     * 根据手机号码获取患者密码
     * @param mobile 手机号
     * @return
     */
    public String getPatientPhone(String mobile){
        String response="";
        long timespan = System.currentTimeMillis();
        String sceret = MD5.md5Hex(mobile+timespan+key);
        String url=yktUrl+"patient/get_patient_pwd_by_tel?tel="+mobile+"&timespan="+timespan+"&token="+sceret;
        logger.info("根据手机号码获取患者密码="+url);
        response = httpClientUtil.get(url,"UTF-8");
        logger.info("根据手机号码获取患者密码"+response);
        return response;
    }
}

+ 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());
        }
    }
}

+ 314 - 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,301 @@ 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());
            //总人数
            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+";点击查看。";
            if(wechatId.equalsIgnoreCase("xm_mlwyy_wx")){
                if (doctorDO!=null){
                    if(!StringUtils.isNoneBlank(doctorDO.getOpenid())){
                        logger.info("该用户"+doctorDO.getName()+"没有openid,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
                    }else{
                        String date = DateUtil.getStringDateShort();
                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_tjjg_notice","jksbhztj",1);
                        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                        BeanUtils.copyProperties(config,newConfig);
                        String des1 = "今日上报情况:已上报:"+sqlTotal+",未上报:"+weishangbaoTotal+",异常:"+yichangTotal+"。";
                        newConfig.setKeyword1(des1);
                        newConfig.setKeyword2(date);
                        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
                        logger.info("=======setUrl========"+newConfig.getUrl());
                        weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(),doctorDO.getOpenid(),newConfig);
                    }
                    //保存发送模板记录,
                    WxPushLogDO wxPushLogDO = new WxPushLogDO();
                    wxPushLogDO.setCreateTime(new Date());
                    wxPushLogDO.setOpenid(doctorDO.getOpenid());
                    wxPushLogDO.setReceiver(doctorDO.getId());
                    wxPushLogDO.setWechatId(wechatId);
                    wxPushLogDO.setReceiverName(doctorDO.getName());
                    wxPushLogDO.setScene("jkzldbxmtz");
                    wxPushLogDao.save(wxPushLogDO);
                }
            }else{
                if (doctorDO!=null){
                    WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
                    if(enterpriseUserDO==null){
                        logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
                    }else{
                        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());
            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+";点击查看。";
                if(wechatId.equalsIgnoreCase("xm_mlwyy_wx")){
                    if(!StringUtils.isNoneBlank(doctorDO.getOpenid())){
                        logger.info("该用户"+doctorDO.getName()+"没有openid,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
                    }else{
                        String date = DateUtil.getStringDateShort();
                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_tjjg_notice","jksbhztj",1);
                        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
                        BeanUtils.copyProperties(config,newConfig);
                        String des1 = "今日上报情况:已上报:"+sqlTotal+",未上报:"+weishangbaoTotal+",异常:"+yichangTotal+"。";
                        newConfig.setKeyword1(des1);
                        newConfig.setKeyword2(date);
                        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
                        logger.info("=======setUrl========"+newConfig.getUrl());
                        weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(),doctorDO.getOpenid(),newConfig);
                    }
                    //保存发送模板记录,
                    WxPushLogDO wxPushLogDO = new WxPushLogDO();
                    wxPushLogDO.setCreateTime(new Date());
                    wxPushLogDO.setOpenid(doctorDO.getOpenid());
                    wxPushLogDO.setReceiver(doctorDO.getId());
                    wxPushLogDO.setWechatId(wechatId);
                    wxPushLogDO.setReceiverName(doctorDO.getName());
                    wxPushLogDO.setScene("jkzldbxmtz");
                    wxPushLogDao.save(wxPushLogDO);
                }else{
                    WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId,doctorDO.getMobile());
                    if(enterpriseUserDO==null){
                        logger.info("该用户"+doctorDO.getName()+"没有企业微信手机号,无法推送模版消息,用户ID:"+doctorDO.getId()+"wechatId:"+wechatId);
                    }else{
                        String url = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/#/home/index";
                        String res = enterpriseService.sendTWMesByDoctor(wechatId,doctorDO.getId(),title,des,url);
                    }
                }
            }
        }
    }
}

+ 13 - 5
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -530,7 +530,9 @@ public class PrescriptionStatusUpdateService {
                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
                try {
                    if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
                        businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                        if (businessOrderDO.getStatus()==1) {
                            businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                        }
                        //眼科接诊时更新眼科通状态
                        if (businessOrderDO != null) {
                            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(), "2");
@ -539,7 +541,10 @@ public class PrescriptionStatusUpdateService {
                        WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("isCloseRefund");
                        if (hospitalSysDictDO!=null&&hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                            try {
                                entranceService.hisRefund(outPatientId);
                                if (businessOrderDO.getStatus()==1){
                                    entranceService.hisRefund(outPatientId);
                                }
                            }catch (Exception e){
                                e.printStackTrace();
                            }
@ -644,8 +649,9 @@ public class PrescriptionStatusUpdateService {
                        }
                        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
                        if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
                            businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                            //眼科接诊时更新眼科通状态
                            if (businessOrderDO.getStatus()==1) {
                                businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                            }//眼科接诊时更新眼科通状态
                            if (businessOrderDO!=null){
                                ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                            }
@ -653,7 +659,9 @@ public class PrescriptionStatusUpdateService {
                            WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("isCloseRefund");
                            if (hospitalSysDictDO!=null&&hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                                try {
                                    entranceService.hisRefund(outPatientId);
                                    if (businessOrderDO.getStatus()==1){
                                        entranceService.hisRefund(outPatientId);
                                    }
                                }catch (Exception e){
                                    e.printStackTrace();
                                }

+ 9 - 5
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java

@ -189,16 +189,20 @@ public class TimeoutOverDueService {
                                }
                                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
                                if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
                                    businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                                    //眼科接诊时更新眼科通状态
                                    if (businessOrderDO!=null){
                                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                                    if (businessOrderDO.getStatus()==1){
                                        businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                                        //眼科接诊时更新眼科通状态
                                        if (businessOrderDO!=null){
                                            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                                        }
                                    }
                                } else if (wechatId.equalsIgnoreCase("xm_zsyy_wx")) {
                                    WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("isCloseRefund");
                                    if (hospitalSysDictDO!=null&&hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                                        try {
                                            entranceService.hisRefund(outPatientId);
                                            if (businessOrderDO.getStatus()==1){
                                                entranceService.hisRefund(outPatientId);
                                            }
                                        }catch (Exception e){
                                            e.printStackTrace();
                                        }

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

@ -17,10 +17,7 @@ import com.yihu.jw.job.ykyy.UpdateStatusByPayTimeJob;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
import com.yihu.jw.repository.job.QuartzJobConfigDao;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.channel.HealthUploadService;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import com.yihu.jw.service.channel.RemindDoctorService;
import com.yihu.jw.service.channel.SyncWlyyHospitalService;
import com.yihu.jw.service.channel.*;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.AutoTimeOutRemind;
import com.yihu.jw.util.OverdueJob;
@ -30,6 +27,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;
@ -93,6 +91,8 @@ public class JobController extends BaseController {
    private SyncWlyyHospitalService syncWlyyHospitalService;
    @Autowired
    private HealthUploadService healthUploadService;
    @Autowired
    private TimeoutOverDueService timeoutOverDueService;
    @Autowired
    public JobController(JobService jobService, QuartzHelper quartzHelper) {
@ -223,7 +223,7 @@ public class JobController extends BaseController {
                    }
                    break;
                case "send_health_upload_job" :
                    //互联网医院 待结算消息推送
                    //马銮湾健康上报未填写推送
                    if (!quartzHelper.isExistJob("send_health_upload_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("send_health_upload_job");
                        quartzHelper.addJob(SendDoctorHealthUploadMessageJob.class, trigger, "send_health_upload_job", new HashMap<String, Object>());
@ -232,6 +232,56 @@ 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 "send_health_total_upload_job" :
                    //马銮湾健康上报上报汇总
                    if (!quartzHelper.isExistJob("send_health_total_upload_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("send_health_total_upload_job");
                        quartzHelper.addJob(HealthUploadTotalRemindMessageJob.class, trigger, "send_health_total_upload_job", new HashMap<String, Object>());
                        logger.info("send_health_total_upload_job  job success");
                    } else {
                        logger.info("send_health_total_upload_job  job exist");
                    }
                    break;
                case "syn_doctor_info_job" :
                    //互联网医院 医生信息同步
                    if (!quartzHelper.isExistJob("syn_doctor_info_job")) {
@ -535,7 +585,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 +595,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) {
@ -832,6 +901,13 @@ public class JobController extends BaseController {
        return success("操作成功");
    }
    @RequestMapping(value = "/cancelOutPatientOver", method = RequestMethod.GET)
    @ApiOperation("cancelOutPatientOver")
    public String syncTeamMemberByTime(){
        timeoutOverDueService.cancelOutPatientOver();
        return success("操作成功");
    }
    @RequestMapping(value = "/ykinternetUpload", method = RequestMethod.GET)
    @ApiOperation("眼科监管平台测试")
    public String ykinternetUpload(String taskId,String endDate,String startDate,String keyId) {

+ 40 - 1
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -125,7 +125,7 @@ fastDFS:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  id: xm_mlwyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  ids: xm_zsyy_wx
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
@ -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 * * * ?

+ 8 - 1
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital-job
    name: svr-internet-hospital-job-wangzinan
  cloud:
    config:
      failFast: true
@ -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}

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

@ -29,5 +29,15 @@ uncheck_prescription_notice_job=0 */1 * * * ?
syn_doctor_info_job=0 0 1 * * ?
send_health_upload_job=0 0 10/1 * * ?
send_health_upload_job=0 0 9,11,15 * * ?
send_health_total_upload_job=0 0 16 * * ?
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 * * ? *

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

@ -3712,6 +3712,17 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("/getDoctorAppointDate")
    @ApiOperation(value = "获取某个医生排班", notes = "获取某个医生排班")
    public Envelop getDoctorAppointDate(
            @ApiParam(name = "doctorId", value = "doctorId")
            @RequestParam(value = "doctorId", required = false) String doctorId) {
        try {
            return success("操作成功", prescriptionService.getDoctorAppointDate(doctorId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 40 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -484,4 +484,44 @@ public class YkyyController extends EnvelopRestEndpoint {
        System.out.println("企业模板消息"+response);
        return success(ykyyEntranceService.sendMesToYkt(doctor,patient,orderType));
    }
    /**
     *
     * 获取患者密码
     * @param mobile
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getPatientPhone", method = RequestMethod.POST)
    @ApiOperation("获取患者密码")
    public ObjEnvelop getPatientPhone(
            @ApiParam(name = "mobile", value = "mobile", required = true)
            @RequestParam(required = true)String mobile) throws Exception {
        try {
            ykyyService.getPatientPhone(mobile);
            return ObjEnvelop.getSuccess("ok","");
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     *
     * 获取医生密码
     * @param mobile
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getDoctorPhone", method = RequestMethod.POST)
    @ApiOperation("获取医生密码")
    public ObjEnvelop getDoctorPhone(
            @ApiParam(name = "mobile", value = "mobile", required = true)
            @RequestParam(required = true)String mobile) throws Exception {
        try {
            ykyyService.getDoctorPhone(mobile);
            return ObjEnvelop.getSuccess("ok","");
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-internet-hospital
    name:  svr-internet-hospital-wangzhinan
  cloud:
    config:
      failFast: true