Ver código fonte

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 5 anos atrás
pai
commit
5fcaa185a5

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

@ -19,6 +19,7 @@ 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.lang3.StringUtils;
@ -53,11 +54,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 +132,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 +267,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        jb.put("third_compeny_prot", "");
        JSONArray jsonArray = new JSONArray();
        jsonArray.add(jb);
@ -296,7 +301,8 @@ 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" +
@ -322,7 +328,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 +341,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 +358,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;
@ -1429,6 +1435,71 @@ 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;
        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"));
        }
        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("protocol_type", "1");
            jb.put("protocol_name", "用户协议信息");
            jb.put("upload_time", 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){

+ 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

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

Diferenças do arquivo suprimidas por serem muito extensas
+ 63 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/UpPrescription.java


+ 12 - 0
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 :
            }

+ 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-----------------------------#