Browse Source

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

wangzhinan 5 years ago
parent
commit
7937602ef2
25 changed files with 709 additions and 104 deletions
  1. 1 0
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java
  2. 31 20
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 249 53
      business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java
  4. 6 1
      business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java
  5. 18 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/BasePatientWechatDao.java
  6. 48 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WxTemplateService.java
  7. 15 13
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  8. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java
  9. 76 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/BasePatientWechatDo.java
  10. 3 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  11. 8 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyOutpatientVO.java
  12. 2 1
      server/svr-authentication/src/main/resources/application.yml
  13. 1 1
      server/svr-authentication/src/main/resources/bootstrap.yml
  14. 1 1
      server/svr-configuration/src/main/resources/application.yml
  15. 0 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/wx/WechatController.java
  16. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/wx/WxTemplateController.java
  17. 127 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/YkyyDataUploadJob.java
  18. 63 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/UpPrescription.java
  19. 13 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  20. 1 1
      svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml
  21. 7 1
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  22. 23 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  23. 5 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  24. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  25. 1 1
      svr/svr-internet-hospital/src/main/resources/application.yml

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -253,6 +253,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        if(StringUtils.isNotBlank(newSpecialDisease) && StringUtils.isNotBlank(newSpecialDiseaseCode)){
            String[] split = newSpecialDisease.split(",");
            String[] splitCode = newSpecialDiseaseCode.split(",");
            specialDiseaseDao.deleteByDoctorCode(doctorId);
            for (int i=0;i<split.length;i++ ){
                DoctorSpecialDiseaseDo specialDiseaseDo = new DoctorSpecialDiseaseDo();
                specialDiseaseDo.setDoctorCode(doctorId);

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

@ -815,16 +815,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * 获取所有医院列表
     * @return
     */
    public List<BaseOrgVO> findAllHospital(Integer level){
        if(level!=null){
            List<BaseOrgDO> list = baseOrgDao.findByLevelAndDel(level,"1");
            List<BaseOrgVO> rs = new ArrayList<>();
            return convertToModels(list,rs,BaseOrgVO.class);
        }else {
            List<BaseOrgDO> list = baseOrgDao.findByDel("1");
            List<BaseOrgVO> rs = new ArrayList<>();
            return convertToModels(list,rs,BaseOrgVO.class);
    public List<BaseOrgVO> findAllHospital(Integer level,String keyWord){
    
        if (StringUtils.isNoneEmpty(keyWord)) {
            keyWord = "%" + keyWord + "%";
    
            if(level!=null){
                List<BaseOrgDO> list = baseOrgDao.findByLevelAndName(level,"1",keyWord);
                List<BaseOrgVO> rs = new ArrayList<>();
                return convertToModels(list,rs,BaseOrgVO.class);
            }else {
                List<BaseOrgDO> list = baseOrgDao.findByDelAndName("1",keyWord);
                List<BaseOrgVO> rs = new ArrayList<>();
                return convertToModels(list,rs,BaseOrgVO.class);
            }
        }else{
    
            if(level!=null){
                List<BaseOrgDO> list = baseOrgDao.findByLevelAndDel(level,"1");
                List<BaseOrgVO> rs = new ArrayList<>();
                return convertToModels(list,rs,BaseOrgVO.class);
            }else {
                List<BaseOrgDO> list = baseOrgDao.findByDel("1");
                List<BaseOrgVO> rs = new ArrayList<>();
                return convertToModels(list,rs,BaseOrgVO.class);
            }
        }
    }
    /**
@ -3117,9 +3134,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " d.id, " +
                    " d.`name`, " +
                    " h.org_code, " +
                    " h.org_name, " +
                    " h.dept_code, " +
                    " h.dept_name " +
                    " h.org_name " +
                    " FROM " +
                    " base_doctor d " +
                    " JOIN base_doctor_hospital h ON d.id= h.doctor_code " +
@ -3136,9 +3151,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " d.id, " +
                    " d.`name`, " +
                    " h.org_code, " +
                    " h.org_name, " +
                    " h.dept_code, " +
                    " h.dept_name " +
                    " h.org_name " +
                    " FROM " +
                    " base_doctor d " +
                    " JOIN base_doctor_hospital h ON d.id= h.doctor_code " +
@ -3154,9 +3167,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " d.id, " +
                    " d.`name`, " +
                    " h.org_code, " +
                    " h.org_name, " +
                    " h.dept_code, " +
                    " h.dept_name " +
                    " h.org_name " +
                    " FROM " +
                    " base_doctor d " +
                    " JOIN base_doctor_hospital h ON d.id= h.doctor_code " +
@ -3189,8 +3200,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    WlyyDoctorWorkTimeDO t = new WlyyDoctorWorkTimeDO();
                    t.setDoctor((String)doctor.get("id"));
                    t.setDoctorName((String)doctor.get("name"));
                    t.setDept((String)doctor.get("dept_code"));
                    t.setDeptName((String)doctor.get("dept_name"));
//                    t.setDept((String)doctor.get("dept_code"));
//                    t.setDeptName((String)doctor.get("dept_name"));
                    t.setHospital((String)doctor.get("org_code"));
                    t.setHospitalName((String)doctor.get("org_name"));
                    t.setCreateTime(new Date());

+ 249 - 53
business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java

@ -19,8 +19,10 @@ import com.yihu.jw.utils.ImgUtils;
import com.yihu.jw.utils.JSONUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.encode.AESUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.ylzinfo.ehc.common.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,11 +55,14 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
    @Autowired
    private WlyyHospitalSysDictDao dictDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    static String userName = "xmykzx";
    static String psw = "7j39c7";
    static String appId = "ws022";
    static String AesEncodeKey = "834irjf3jd39rh2m";
    //http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?
    static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl";  // 正式线路径
 //   static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl";   // 测试线路径
    static String method = "execute";
@ -128,7 +133,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        jb.put("organ_name",orgName);
        jb.put("corporation", "苏庆灿");
        jb.put("no_pra_lic", "42660991-335020016A5122");
        jb.put("second_organ_name", "");
        jb.put("second_organ_name", "厦门眼科中心");
        jb.put("charge_person", "");
        jb.put("level", "1");
@ -263,6 +268,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        jb.put("third_compeny_prot", "");
        JSONArray jsonArray = new JSONArray();
        jsonArray.add(jb);
@ -273,7 +279,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
    }
    // 3 医师基本信息	micc.upNsDoctorRecord   --- 完成
    public String upNsDoctorRecord(String startDate, String endDate,String keyId) throws Exception {
    public String upNsDoctorRecord(String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upNsDoctorRecord";
        String upid = getCode();
@ -296,18 +302,13 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                "   a.mobile AS \"mobile\"," +
                "   b.dept_code AS \"dept_code\"," +
                "   b.dept_name AS \"dept_name\"," +
                "   a.job_title_code AS \"job_title_code\"" +
                "   a.job_title_code AS \"job_title_code\"," +
                "   a.fzrq AS \"fzrq\"" +
                "  from base_doctor a " +
                "      ,base_doctor_hospital b" +
                " where a.id = b.doctor_code" +
                "   and b.dept_code is NOT NULL ";
        if(StringUtils.isNotBlank(startDate)){
            sql =  sql + "  and a.update_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            sql =  sql +  "  and a.update_time < '" + endDate + "' ";
        }
        if(StringUtils.isNotBlank(keyId)){
            sql =  sql +  "  and a.id = '" + keyId + "' ";
        }
@ -322,7 +323,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
            Boolean errorFlag = false;
            JSONObject jb = new JSONObject();
            try {
                String[] dept = depToSubject("1090000");
                String[] dept = depToSubject(jb.getString("dept_code"));
                // 中山医院 监管平台  职务字典强转
                String[] dutyInfo = classToduty(info.get("job_title_code").toString());
@ -335,10 +336,10 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                jb.put("birthday", info.get("birthday")  == null?"1900-01-01": DateUtil.dateToStrLong((Date)info.get("birthday")));
                jb.put("subject", dept[0].toString());
                jb.put("subject_name", dept[1].toString());
                jb.put("belong_dept","1090000");
                jb.put("belong_dept_name", "眼科");
                jb.put("belong_dept",jb.getString("dept_code"));
                jb.put("belong_dept_name", jb.getString("dept_name"));
                jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
//                jb.put("title_rec_date", info.get("fzrq"));
                jb.put("title_rec_date", info.get("fzrq"));
                jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
                jb.put("title_code", dutyInfo[0].toString());  // 需要与监管平台的字典进行映射
                jb.put("first_compeny_code", orgCode);
@ -352,7 +353,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                jb.put("doc_cert",ImgUtils.getImageStr("D:"+ File.separator+"zstp"+File.separator+info.get("name")+File.separator+"zg.jpg"));
                //执业证书
                jb.put("cert_doc_prac", ImgUtils.getImageStr("D:"+ File.separator+"zstp"+File.separator+info.get("name")+File.separator+"zy.jpg"));
                jb.put("txt_introduction", "");
                jb.put("txt_introduction", "厦门大学附属厦门眼科中心成立于1997年11月8日,是集医疗、教学、科研、防盲为一体的三级甲等眼科医院、国家临床重点专科、国家药物临床试验机构。设有国家博士后科研工作站、院士专家工作站、全国住院医师规培基地、转化医学研究所等。");
            }catch (Exception e){
                errorFlag = true;
@ -376,7 +377,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"3",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        saveUpLog(upid,"3",new Date(),new Date(),success,error,dataError,resInfo);
        return resInfo;
    }
@ -428,22 +429,25 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                "   p.register_date AS \"date\"" +
                "   FROM wlyy_outpatient p " +
                " WHERE 1=1" ;
        Map<String,Object> params = new HashedMap();
        if(StringUtils.isNotBlank(startDate)){
            sql =  sql + "  and reg.create_time >=  '" + startDate + "' ";
            sql =  sql + "  and reg.create_time >=:startDate ";
            params.put("startDate",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(endDate)){
            sql =  sql +  "  and reg.create_time < '" + endDate + "' ";
            sql =  sql +  "  and reg.create_time <=:endDate";
            params.put("endDate",DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(keyId)){
            sql =  sql +  "  and  p.id = '" + keyId + "' ";
            sql =  sql +  "  and  p.id =:keyId ";
            params.put("keyId",keyId);
        }
        List list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
        total = list.size();
        for(int i=0; i< total; i++){
            LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap)list.get(i);
            Map<String,Object> info = list.get(i);
            JSONObject jb = new JSONObject();
            Boolean errorFlag = false;
            try{
@ -602,27 +606,6 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        String token = upNsUserToken(url);
//        String sql = "select " +
//                "      a.id AS \"id\", " +
//                "      c.name AS \"name\"," +
//                "      a.score AS \"score\"," +
//                "      a.patient_name AS \"patient_name\"," +
//                "      a.create_time AS \"create_time\"," +
//                "      content_table.content AS \"content\"," +
//                "      c.idcard AS \"docIdCard\", " +
//                "      d.dept_code AS \"dept_code\", " +
//                "      d.dept_name AS \"dept_name\" "+
//                "  from  base_evaluate_score a ," +
//                "     ( select " +
//                "        a.relation_code AS \"rcode\"," +
//                "        group_concat(a.content order by a.content desc)  as content" +
//                "      from base_evaluate a" +
//                "       group by a.relation_code ) content_table," +
//                "     base_doctor c," +
//                "     base_doctor_hospital d " +
//                " where content_table.rcode = a.id " +
//                "   and c.id = a.doctor" +
//                "   and c.id = d.doctor_code";
        String sql ="SELECT " +
                " a.id AS \"id\", " +
                " a.doctor_name AS \"name\", " +
@ -637,23 +620,27 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                "JOIN base_doctor d ON d.id = a.doctor " +
                "WHERE " +
                " e.score_type = '4'";
        Map<String,Object> params = new HashedMap();
        if(StringUtils.isNotBlank(startDate)){
            sql =  sql + "  and a.create_time >=  '" + startDate + "' ";
            sql =  sql + "  and a.create_time >=:startDate ";
            params.put("startDate",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(endDate)){
            sql =  sql +  "  and a.create_time < '" + endDate + "' ";
            sql =  sql +  "  and a.create_time <=:endDate";
            params.put("endDate",DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(keyId)){
            sql =  sql +  "  and a.id = '" + keyId + "' ";
            sql =  sql +  "  and  a.id =:keyId ";
            params.put("keyId",keyId);
        }
        List list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
        total = list.size();
        for(int i=0; i<list.size(); i++) {
            LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap) list.get(i);
            Map<String,Object> info =list.get(i);
            Boolean errorFlag = false;
            JSONObject jb = new JSONObject();
@ -755,21 +742,25 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
               "\ta.id = b.consult\n" +
               "AND a.symptoms IS NOT NULL AND b.status=1";
        Map<String,Object> params = new HashedMap();
        if(StringUtils.isNotBlank(startDate)){
            sql =  sql + "  and a.czrq >=  '" + startDate + "' ";
            sql =  sql + "  and a.czrq >=:startDate ";
            params.put("startDate",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(endDate)){
            sql =  sql +  "  and a.czrq < '" + endDate + "' ";
            sql =  sql +  "  and a.czrq <=:endDate";
            params.put("endDate",DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(keyId)){
            sql =  sql +  "  and a.id = '" + keyId + "' ";
            sql =  sql +  "  and  a.id =:keyId ";
            params.put("keyId",keyId);
        }
        List list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
        total = list.size();
        for(int i=0; i<total; i++) {
            LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap) list.get(i);
            Map<String,Object> info = list.get(i);
            String sqlMessage ="SELECT\n" +
                    "\tM .SENDER_NAME AS \"sender_name\",\n" +
                    "\tM .\"TIMESTAMP\" AS \"timestamp\",\n" +
@ -1429,6 +1420,211 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        return resInfo;
    }
    public String upNsInvokeTotal(String startDate, String endDate,String keyId) throws Exception {
        String url = getUrl();
        String api = "micc.upNsInvokeTotal";
        String upid = getCode();
        String token = upNsUserToken(url);
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        int dataError = 0;
        //5.统计预约量
        String yyghSql = "SELECT " +
                "   count(1) AS \"yyghtotal\"" +
                " FROM wlyy_outpatient p " +
                " WHERE 1=1" ;
        if(StringUtils.isNotBlank(startDate)){
            yyghSql =  yyghSql + "  and reg.create_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            yyghSql =  yyghSql +  "  and reg.create_time < '" + endDate + "' ";
        }
        List<Map<String,Object>> yygh = hibenateUtils.createSQLQuery(yyghSql);
        Long yyghtotal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            yyghtotal = hibenateUtils.objTransformLong(yygh.get(0).get("yyghtotal"));
        }
        //7.医生评价
        String yypjSql ="SELECT " +
                "   count(1) AS \"yypjtotal\"" +
                " FROM " +
                " base_evaluate_score a " +
                " JOIN base_evaluate e ON a.id = e.relation_code " +
                " JOIN base_doctor d ON d.id = a.doctor " +
                " WHERE " +
                " e.score_type = '4'";
        if(StringUtils.isNotBlank(startDate)){
            yypjSql =  yypjSql + "  and a.create_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            yypjSql =  yypjSql +  "  and a.create_time < '" + endDate + "' ";
        }
        List<Map<String,Object>> yypj = hibenateUtils.createSQLQuery(yypjSql);
        Long yypjtotal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            yypjtotal = hibenateUtils.objTransformLong(yypj.get(0).get("yypjtotal"));
        }
        //8.统计网络咨询
        String wlzxSql = "SELECT\n" +
                "   count(1) AS \"wlzxtotal\"" +
                "FROM\n" +
                "\twlyy_consult a ,\n" +
                "\twlyy_consult_team b \n" +
                "JOIN base_doctor c ON c.id = b.doctor \n" +
                "JOIN base_patient d ON d.id = b.patient \n" +
                "JOIN base_doctor_hospital e ON e.doctor_code = b.doctor \n" +
                "JOIN topics t ON t.id = b.consult\n" +
                "WHERE\n" +
                "\ta.id = b.consult\n" +
                "AND a.symptoms IS NOT NULL AND b.status=1";
        if(StringUtils.isNotBlank(startDate)){
            wlzxSql =  wlzxSql + "  and a.czrq >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            wlzxSql =  wlzxSql +  "  and a.czrq < '" + endDate + "' ";
        }
        List<Map<String,Object>> wlzx = hibenateUtils.createSQLQuery(wlzxSql);
        Long wlzxtotal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            wlzxtotal = hibenateUtils.objTransformLong(wlzx.get(0).get("wlzxtotal"));
        }
        //9.网络诊疗服务
        String wlzlSql = "select " +
                "   count(1) AS \"wlzltotal\"" +
                "  from wlyy_outpatient a " +
                "      join base_doctor b on b.id = a.doctor" +
                "      join base_patient c on c.id = a.patient" +
                " where a.register_no is NOT NULL and a.dept is not null " +
                " and a.register_date is not null " ;
        if(StringUtils.isNotBlank(startDate)){
            wlzlSql =  wlzlSql + "  and a.create_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            wlzlSql =  wlzlSql +  "  and a.create_time < '" + endDate + "' ";
        }
        List<Map<String,Object>> wlzl = hibenateUtils.createSQLQuery(wlzlSql);
        Long wlzltotal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            wlzltotal = hibenateUtils.objTransformLong(wlzl.get(0).get("wlzltotal"));
        }
        //10.电子处方
        String dzcfsql = "select " +
                "   count(1) AS \"dzcftotal\"" +
                "  from  wlyy_prescription a" +
                "     JOIN base_patient b on a.patient_code = b.id " +
                "     JOIN base_doctor c on a.doctor = c.id " +
                "     JOIN wlyy_outpatient p on p.id = a.outpatient_id  " +
                "  where  c.idcard is not null  and a.real_order is not null and p.icd10 is not null ";
        if(StringUtils.isNotBlank(startDate)){
            dzcfsql =  dzcfsql + "  and a.create_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            dzcfsql =  dzcfsql +  "  and a.create_time < '" + endDate + "' ";
        }
        List<Map<String,Object>> dzcf = hibenateUtils.createSQLQuery(dzcfsql);
        Long dzcftotal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            dzcftotal = hibenateUtils.objTransformLong(dzcf.get(0).get("dzcftotal"));
        }
        //11.电子处方药品明细
        String infosql = "select " +
                "   count(1) AS \"infototal\"" +
                "  from wlyy_prescription_info a " +
                "     JOIN wlyy_prescription b " +
                "     on b.id = a.prescription_id" +
                "  where  a.dosage is not null and b.real_order is not null";
        if(StringUtils.isNotBlank(startDate)){
            infosql =  infosql + "  and b.create_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            infosql =  infosql +  "  and b.create_time < '" + endDate + "' ";
        }
        List<Map<String,Object>> info = hibenateUtils.createSQLQuery(infosql);
        Long infototal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            infototal = hibenateUtils.objTransformLong(info.get(0).get("infototal"));
        }
        //12.过程图片
        String gctpsql = "SELECT " +
                "   count(1) AS \"gctptotal\"" +
                " FROM wlyy_outpatient p " +
                " WHERE p.disease_img is not null ";
        if(StringUtils.isNotBlank(startDate)){
            gctpsql =  gctpsql + "  and p.create_time >=  '" + startDate + "' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            gctpsql =  gctpsql +  "  and p.create_time < '" + endDate + "' ";
        }
        List<Map<String,Object>> gctp = hibenateUtils.createSQLQuery(gctpsql);
        Long gctptotal = 0L;
        if(yyghtotal!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            gctptotal = hibenateUtils.objTransformLong(gctp.get(0).get("gctptotal"));
        }
        JSONObject jb = new JSONObject();
        Boolean errorFlag = false;
        try {
            jb.put("id_ws_invoke_total",upid);
            jb.put("organ_code", orgCode);
            jb.put("organ_name",orgName);
            jb.put("wsyy_upload_count", yyghtotal);
            jb.put("yspj_upload_count", yypjtotal);
            jb.put("wlzx_upload_count", wlzxtotal);
            jb.put("wlzl_upload_count", wlzltotal);
            jb.put("dzcf_upload_count", dzcftotal);
            jb.put("ypmx_upload_count", infototal);
            jb.put("gctp_upload_count", gctptotal);
            jb.put("ywsj", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
        }catch (Exception e){
            errorFlag = true;
            saveErrorLog(upid,"13",upid,res,1);
            dataError++;
            logger.error(e.toString());
        }
        if(!errorFlag){
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(jb);
            res = postToInter(token,api, jsonArray,url);
            JSONObject resJson = (JSONObject) JSONObject.parse(res);
            if("200".equals(resJson.get("msg").toString())){
                success++;
            }else{
                saveErrorLog(upid,"13",upid,res,2);
                error++;
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
        saveUpLog(upid,"13",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
        return resInfo;
    }
    // 基于医生所在科室,转换成国家诊疗科目代码(中山医院专用)
    // 当科室信息在列表中不存在的情况,全部配置为预防保健科
    public static  String[]  depToSubject(String dep){

+ 6 - 1
business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java

@ -49,6 +49,11 @@ public interface BaseOrgDao extends PagingAndSortingRepository<BaseOrgDO, String
    List<BaseOrgDO> findByCityCodeAndLevel(String cityCode,Integer level);
    List<BaseOrgDO> findByDel(String del);
    @Query(value="select b.* from base_org b where b.del=?1  and b.name like ?2 ORDER BY sort DESC",nativeQuery = true)
    List<BaseOrgDO> findByDelAndName(String del,String name);
    
    @Query(value="select b.* from base_org b where b.level= ?1 and b.del=?2  and b.name like ?3 ORDER BY sort DESC",nativeQuery = true)
    List<BaseOrgDO> findByLevelAndName(Integer level,String del,String name);
    
    List<BaseOrgDO> findByLevelAndDel(Integer level,String del);
}

+ 18 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/dao/BasePatientWechatDao.java

@ -0,0 +1,18 @@
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author huangwenjie
 * @date 2020/3/10 14:43
 */
public interface BasePatientWechatDao extends
		PagingAndSortingRepository<BasePatientWechatDo, String>,
		JpaSpecificationExecutor<BasePatientWechatDo> {
	
	List<BasePatientWechatDo> findByWechatIdAndPatientId (String wechatid,String patientId);
}

+ 48 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WxTemplateService.java

@ -1,20 +1,24 @@
package com.yihu.jw.base.service.wx;
package com.yihu.jw.wechat.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.base.wx.WxTemplateDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.dao.WxTemplateDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -39,7 +43,48 @@ public class WxTemplateService {
    @Autowired
    private WeixinMessagePushUtils weixinMessagePushUtils;
    
    @Value("${wechat.id}")
    private String wechatId;
    
    @Autowired
    private BasePatientDao basePatientDao;
    
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    
    
    /**
     * 发送微信模版消息-小程序视频
     * @param sender_id 发送者ID
     * @param sender_name 发送者姓名
     * @param reciver_id 接收者ID
     * @param reciver_name 接收者姓名
     * @param session_id 会话ID
     */
    public String sendWeTempMesMiniProgram(String sender_id, String sender_name, String reciver_id, String reciver_name,String session_id)throws Exception {
        BasePatientDO basePatientDO = basePatientDao.findById(reciver_id);
        if(basePatientDO!=null){
            List<BasePatientWechatDo> ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,reciver_id);
            if(ps.isEmpty()){
                logger.info("该用户"+sender_name+"没有openid,无法推送模版消息,用户ID:"+sender_id);
            }else{
                for (BasePatientWechatDo basePatientWechatDo:ps){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_consult_notice","spthtx",1);
                    config.setFirst(config.getFirst().replace("key1",sender_name));
                    config.setPagepath(config.getPagepath()+""+reciver_id+"&doctorName="+sender_name+"&role=patient&roomID="+session_id+"&template=1v1&debugMode=false&cloudenv=PRO");
                    weixinMessagePushUtils.putWxMsg(wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken(),basePatientWechatDo.getOpenid(),config);
                }
            }
        }else{
            throw new Exception("接收者ID错误,无法找到该账号");
        }
        return "success";
    }
    
    public String sendWeTempMesTest(String wechatId,String openid)throws Exception{
        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_survey","test",1);
        config.setFirst(config.getFirst().replace("key1","小明"));
@ -93,4 +138,5 @@ public class WxTemplateService {
        }
        return rs;
    }
}

+ 15 - 13
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -170,7 +170,7 @@ public class ImService {
	 * @param status 状态
	 * @return
	 */
	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,Integer type, int page,int pagesize, String title,Integer status) {
	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status) {
		if(page >=1){
			page --;
@ -197,7 +197,7 @@ public class ImService {
				"base_doctor d, " +
				"base_doctor_hospital h " +
				"WHERE a.id=b.consult and d.id = h.doctor_code " +
				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type="+type;
				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type in ("+type+")";
		List<ConsultVO> result = new ArrayList<>();
		
		if(!StringUtils.isEmpty(title)){
@ -234,7 +234,7 @@ public class ImService {
	 * @param title 标题关键字
	 * @return
	 */
	public Long countConsultRecordByPatient(String patient, String id,Integer type, String title) {
	public Long countConsultRecordByPatient(String patient, String id,String type, String title) {
		
		String  sql = "SELECT " +
				" COUNT(1) AS total " +
@ -242,7 +242,7 @@ public class ImService {
				"wlyy_consult_team b," +
				"base_doctor d " +
				"WHERE a.id=b.consult " +
				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type="+type;
				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type in ("+type+") ";
		List<ConsultVO> result = new ArrayList<>();
		
		if(!StringUtils.isEmpty(title)){
@ -1454,6 +1454,7 @@ public class ImService {
		patientinfoObj.put("sex",basePatientDO.getSex());
		patientinfoObj.put("mobile",basePatientDO.getMobile());
		patientinfoObj.put("address",basePatientDO.getAddress());
		patientinfoObj.put("photo",basePatientDO.getPhoto());
		Integer age = DateUtil.getAgeForIdcard(basePatientDO.getIdcard());
		patientinfoObj.put("age",age);
		result.put("patientInfo",patientinfoObj);
@ -1661,7 +1662,7 @@ public class ImService {
	 * @return
	 */
	public List<ConsultVO>  findConsultRecordByDoctor(String doctor, String id,
	                                                  Integer type, Integer status,
	                                                  String type, Integer status,
	                                                  int page,int pagesize,
	                                                  String title,String start_time,String end_time) {
		
@ -1674,7 +1675,8 @@ public class ImService {
		}
		
		String  sql = "";
		if(1 == type || 15 ==type){
		//专家咨询
		if("1".equals(type) || "15".equals(type) || type.contains(",")){
			sql = "SELECT " +
					"a.id AS id," +
					"a.type AS type," +
@ -1750,9 +1752,9 @@ public class ImService {
			
		}
		
		//咨询状态
		if(type != 0){
				sql +=" AND a.type="+type;
		//咨询类型
		if(!StringUtils.isEmpty(type)){
				sql +=" AND a.type in ("+type+")" ;
		}
		
		if (!StringUtils.isEmpty(id)) {
@ -1775,7 +1777,7 @@ public class ImService {
	 * @param end_time 结束时间
	 * @return
	 */
	public Long countConsultRecordByDoctor(String doctor, String id,Integer type, Integer status,String title,String start_time,String end_time) {
	public Long countConsultRecordByDoctor(String doctor, String id,String type, Integer status,String title,String start_time,String end_time) {
		
		String  sql = "SELECT " +
				" COUNT(1) AS total " +
@ -1812,9 +1814,9 @@ public class ImService {
		}
		
		
		//咨询状态
		if(type != 0){
			sql +=" AND a.type="+type;
		//咨询类型
		if(!StringUtils.isEmpty(type)){
			sql +=" AND a.type in ("+type+")";
		}
		
		if (!StringUtils.isEmpty(id)) {

+ 5 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java

@ -160,6 +160,11 @@ public class BaseOrgDO extends UuidIdentityEntityWithOperator {
     * 机构分部号,每个机构都不一样,例如中山医院:6总部7金榜8夏禾 默认1
     */
    private String winNo;
	
	/**
	 * 排序
	 */
	private Integer sort;
    public BaseOrgDO() {
    }

+ 76 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/BasePatientWechatDo.java

@ -0,0 +1,76 @@
package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * @author huangwenjie
 * @date 2020/3/10 14:39
 */
@Entity
@Table(name = "base_patient_wechat")
public class BasePatientWechatDo extends UuidIdentityEntity {
	
	private String saasId;
	private String wechatId;
	private String patientId;
	private String openid;
	private String unionid;
	private String createTime;
	
	@Column(name = "saas_id")
	public String getSaasId() {
		return saasId;
	}
	
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	
	@Column(name = "wechat_id")
	public String getWechatId() {
		return wechatId;
	}
	
	public void setWechatId(String wechatId) {
		this.wechatId = wechatId;
	}
	
	@Column(name = "patient_id")
	public String getPatientId() {
		return patientId;
	}
	
	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}
	
	public String getOpenid() {
		return openid;
	}
	
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	public String getUnionid() {
		return unionid;
	}
	
	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}
	
	@Column(name = "create_time")
	public String getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
}

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

@ -529,6 +529,9 @@ public class BaseHospitalRequestMapping {
    
        //医生端:查询会话视频邀请状态
        public static final String getVideoInviteStatus="getVideoInviteStatus";
    
        //医生端:发起/断开 会话小程序视频邀请
        public static final String videoInviteMiniProgram="videoInviteMiniProgram";
    }

+ 8 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyOutpatientVO.java

@ -458,4 +458,12 @@ public class WlyyOutpatientVO extends UuidIdentityVO {
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getAdvice() {
        return advice;
    }
    public void setAdvice(String advice) {
        this.advice = advice;
    }
}

+ 2 - 1
server/svr-authentication/src/main/resources/application.yml

@ -103,6 +103,7 @@ zhongshanHospital:
fastDFS:
  fastdfs_file_url: http://192.0.33.26:22122
---
## 心脏中心外网
spring:
  profiles: xzprod
  datasource:
@ -141,4 +142,4 @@ iHealth:
zhongshanHospital:
  user-info-uri: http://laptop-u738dn2p:10023/mqsdk/getUserInfoByOpenid
fastDFS:
  fastdfs_file_url: http://192.168.103.159:22122
  fastdfs_file_url: http://192.168.103.159:22122

+ 1 - 1
server/svr-authentication/src/main/resources/bootstrap.yml

@ -54,7 +54,7 @@ spring:
  profiles: xzprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.16.100.63:1221}
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:

+ 1 - 1
server/svr-configuration/src/main/resources/application.yml

@ -15,7 +15,7 @@ eureka:
    healthcheck:
      enabled: false #启动监控检查,
    serviceUrl: # 默认正式线地址
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka  # 测试环境
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka  # 默认本机环境
#      defaultZone: http://jw:jkzl@172.16.1.42:8761/eureka # 中山医院
#      defaultZone: http://jw:jkzl@192.0.33.26:8762/eureka
#      defaultZone: http://jw:jkzl@192.168.33.199:8761/eureka

+ 0 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/wx/WechatController.java

@ -3,7 +3,6 @@ package com.yihu.jw.base.endpoint.wx;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.wx.WechatService;
import com.yihu.jw.base.service.wx.WxTemplateService;
import com.yihu.jw.entity.base.wx.*;
import com.yihu.jw.restmodel.base.wx.*;
import com.yihu.jw.restmodel.web.Envelop;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/wx/WxTemplateController.java

@ -1,9 +1,9 @@
package com.yihu.jw.base.endpoint.wx;
import com.yihu.jw.base.service.wx.WxTemplateService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.WechatRequestMapping;
import com.yihu.jw.wechat.service.WxTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;

+ 127 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/YkyyDataUploadJob.java

@ -0,0 +1,127 @@
package com.yihu.jw.job.ykyy;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.util.date.DateUtil;
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 2020/3/11.
 */
public class YkyyDataUploadJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DataUploadJob.class);
    @Autowired
    private YkyyInternetService internetService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========DataUploadJob========");
        try {
            //1、获取 JOB 执行区间  执行时间点的前一天  时间点定在每天的 02:00:00 执行,同步前一天的数据
            String endDate = DateUtil.dateToStr(DateUtil.getNow(),"yyyy-MM-dd")+" 00:00:00";
            String startDate = DateUtil.dateToStr(DateUtil.getPreDays(DateUtil.getNow(),-1),"yyyy-MM-dd")+" 00:00:00";
            String res = "";
            //2、分步执行需要JOB执行的服务
            logger.info("START========2.5 网上预约挂号上传开始========");
            try {
                res = internetService.upAppointmentOnline(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.5 网上预约挂号上传结束========" + res);
//            logger.info("START========2.6 网上医技预约上传开始========");
//            try {
//                res = internetService.upMedicalOnline(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.6 网上医技预约上传结束========" + res);
            logger.info("START========2.7 医生评价信息开始========");
            try {
                res = internetService.upNsDoctorScore(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.7 医生评价信息结束========" + res);
            logger.info("START========2.8 网络咨询服务信息开始========");
            try {
                res = internetService.upNsOnlineAsk(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.8 网络咨询服务信息结束========" + res);
            logger.info("START========2.9 网络诊疗服务信息========");
            try {
                res = internetService.upNsOnlineMed(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.9 网络诊疗服务信息========" + res);
            logger.info("START========2.10 电子处方表开始========");
            try {
                res = internetService.upPrescription(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.10 电子处方表结束========" + res);
            logger.info("START========2.11 电子处方_药品明细表开始 ========");
            try {
                res = internetService.upPrescriptionDrug(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
            logger.info("START========2.12 在线诊疗服务信息-过程图片上传 开始========");
            try {
                res = internetService.upNsOnlineImg(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.12 在线诊疗服务信息-过程图片上传 结束========" + res);
            logger.info("END========DataUploadJob 执行结束========");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===DataUploadJob,message:"+e.getMessage());
        }
    }
}

File diff suppressed because it is too large
+ 63 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/UpPrescription.java


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

@ -9,6 +9,7 @@ import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.SystemConf;
@ -121,6 +122,17 @@ public class JobController extends BaseController {
                        logger.info("data_upload_job  job exist");
                    }
                    break;
                case "data_ykupload_job" :
                    //互联网医院 监管平台上报
                    if (!quartzHelper.isExistJob("data_ykupload_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_ykupload_job");
                        quartzHelper.addJob(YkyyDataUploadJob.class, trigger, "data_ykupload_job", new HashMap<String, Object>());
                        logger.info("data_ykupload_job  job success");
                    } else {
                        logger.info("data_ykupload_job  job exist");
                    }
                    break;
                default :
            }
@ -403,7 +415,7 @@ public class JobController extends BaseController {
                    break; //可选
                case "2.3" :
                    //语句
                    ykyyInternetService.upNsDoctorRecord(null,null,null);
                    ykyyInternetService.upNsDoctorRecord(null);
                    break; //可选
                case "2.5" :
                    //语句

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

@ -34,7 +34,7 @@ spring:
  profiles: jwOracleProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:

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

@ -1,4 +1,4 @@
#-------------------------共同配置-----------------------------#
#-------------------------中山医院-----------------------------#
# 健康频道状态
prescriptionStatus_update_job=0 */2 * * * ?
@ -7,3 +7,9 @@ prescription_overdue_job=0 0 1 * * ?
#每天13 点触发
data_upload_job=0 0 2 * * ?
#-------------------------中山医院end-----------------------------#
#-------------------------眼科医院-----------------------------#
data_ykupload_job=0 0 0 * * ?
#-------------------------眼科医院end-----------------------------#

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

@ -7,7 +7,6 @@ import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
@ -26,6 +25,7 @@ import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.service.WxTemplateService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -81,6 +81,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	private HospitalSystemMessageService hospitalSystemMessageService;
	@Autowired
	public BasePatientDao basePatientDao;
	@Autowired
	private WxTemplateService wxTemplateService;
	
	
@ -350,7 +352,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "id", value = "咨询ID")
			@RequestParam(value = "id",required = false) String id,
			@ApiParam(name = "type", value = "咨询类型")
			@RequestParam(value = "type",required = true) Integer type,
			@RequestParam(value = "type",required = true) String type,
			@ApiParam(name = "status", value = "咨询状态:0全部,1候诊中,2就诊中,3结束")
			@RequestParam(value = "status",required = true) Integer status,
			@ApiParam(name = "start_time", value = "开始时间 YYYY-MM-DD HH:MM:SS")
@ -748,4 +750,23 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.videoInviteMiniProgram)
	@ApiOperation(value = "医生端:发起/断开 会话小程序视频邀请", notes = "医生端:发起/断开 会话小程序视频邀请")
	public Envelop videoInviteMiniProgram(@ApiParam(name = "sender_id", value = "发起人")
	                                 @RequestParam(value = "sender_id",required = true) String sender_id,
	                                 @ApiParam(name = "sender_name", value = "发起人名字")
	                                 @RequestParam(value = "sender_name",required = true) String sender_name,
                                      @ApiParam(name = "reciver_id", value = "接收人")
                                      @RequestParam(value = "reciver_id",required = true) String reciver_id,
                                      @ApiParam(name = "reciver_name", value = "接收人")
                                      @RequestParam(value = "reciver_name",required = true) String reciver_name,
                                      @ApiParam(name = "reciver_type", value = "接收人类型1居民 2医生")
                                      @RequestParam(value = "reciver_name",required = true) String reciver_type,
                                      @ApiParam(name = "session_id", value = "会话ID")
                                      @RequestParam(value = "session_id",required = true) String session_id
	                                      )throws Exception  {
		wxTemplateService.sendWeTempMesMiniProgram(sender_id,sender_name,reciver_id,reciver_name,session_id);
		return success("操作成功");
	}
}

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

@ -92,6 +92,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@Value("${fastDFS.fastdfs_file_url}")
	private String fastdfs_file_url;
	
	@Value("${wlyy.url}")
	private String wlyyUrl;
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.records)
	@ApiOperation(value = "患者咨询记录查询")
	public Envelop records(
@ -102,7 +105,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@ApiParam(name = "id", value = "咨询ID")
								@RequestParam(value = "id",required = false) String id,
								@ApiParam(name = "type", value = "咨询类型")
								@RequestParam(value = "type",required = true) Integer type,
								@RequestParam(value = "type",required = true) String type,
								@ApiParam(name = "status", value = "咨询状态:0全部,1候诊中,2就诊中,3结束")
								@RequestParam(value = "status",required = false) Integer status,
								@ApiParam(name = "page", value = "第几页")
@ -416,7 +419,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			}
			//发送厦门i健康智能推送
			try{
				String wxurl = "http://www.xmtyw.cn/wlyy/im/common/message/sendDoctorTemplateByDoctorIdcard?sessionId="+p.getId()+"_"+d.getId()+"_1&sessionType=1&from="+p.getId()+"&content="+URLEncoder.encode(symptoms)+"&businessType=1&doctor_idcard="+d.getIdcard()+"&patientName="+URLEncoder.encode(p.getName())+"&url=1";
				String wxurl = wlyyUrl+"/im/common/message/sendDoctorTemplateByDoctorIdcard?sessionId="+p.getId()+"_"+d.getId()+"_1&sessionType=1&from="+p.getId()+"&content="+URLEncoder.encode(symptoms)+"&businessType=1&doctor_idcard="+d.getIdcard()+"&patientName="+URLEncoder.encode(p.getName())+"&url=1";
				logger.info("发送厦门i健康智能推送url:"+wxurl);
				wlyyBusinessService.sendDoctorTemplateByDoctorIdcard(wxurl);
			}catch (Exception e){

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

@ -208,8 +208,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findAllHospital)
    @ApiOperation(value = "查询所有机构", notes = "查询所有机构")
    public ListEnvelop findAllHospital(@ApiParam(name = "level", value = "医院等级")
                                       @RequestParam(value = "level", required = false)Integer level) {
        return success(prescriptionService.findAllHospital(level));
                                       @RequestParam(value = "level", required = false)Integer level,
                                       @ApiParam(name = "keyWord", value = "名字关键字")
                                       @RequestParam(value = "keyWord", required = false)String keyWord) {
        return success(prescriptionService.findAllHospital(level,keyWord));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByHospital)

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

@ -177,7 +177,7 @@ fastDFS:
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: 97ed8a0a-4f07-4b85-ab02-b716c611a464  # base库中,wx_wechat 的id字段
  id: xm_test_ihealth_wx  # base库中,wx_wechat 的id字段
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP