Trick 5 éve
szülő
commit
4f125f4af3

+ 21 - 0
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -12,12 +12,16 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
@ -128,4 +132,21 @@ public class WlyyBusinessService {
        }
        return false;
    }
//    public String getPatientInfo(String ){
//        List<NameValuePair> params = new ArrayList<>();
//        params.add(new BasicNameValuePair("clientId", getClientId()));
//        ClientDetails clientDetails = clientDetailsService.loadClientByClientId(getClientId());
//        params.add(new BasicNameValuePair("clientSecret", clientDetails.getClientSecret()));
//        params.add(new BasicNameValuePair("code", username));
//        params.add(new BasicNameValuePair("openid", getOpenid()));
//        String res = null;
//        try{
//            res = httpClientUtil.post(getSynPath(getWechatId()), params, "UTF-8");
//        }catch (Exception e){
//            logger.error("远程请求i健康用户信息异常:" + e.getMessage());
//            return users;
//        }
//    }
}

+ 16 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/WlyyThirdController.java

@ -0,0 +1,16 @@
package com.yihu.jw.entrance.controller.third;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Trick on 2019/10/9.
 */
@RestController
@RequestMapping(value ="/wlyyThird")
@Api(value = "厦门I健康内网信息同步", description = "厦门I健康内网信息同步", tags = {"厦门I健康内网信息同步"})
public class WlyyThirdController extends EnvelopRestEndpoint {
}

+ 2 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionStatusUpdateJob.java

@ -11,7 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
 * 处方状态更新job
 * Created by zdm on 2019/2/20.
 * 互联网医院线上下处方之后保存到中山医院的临时表-(中山医院正式下处方,审核成功之后保存,审核失败不保存)-审核成功之后药房发药,回调互联网医院。
 * 互联网医院线上下处方之后保存到中山医院的临时表-
 * (中山医院正式下处方,审核成功之后保存,审核失败不保存)-审核成功之后药房发药,回调互联网医院。
 * 在正式下处方的时候,互联网医院每两分钟到中山医院获取处方详情:
 * 1、若是可以正常查询且状态为审方成功,则只需要变更状态,调用im消息通知居民
 * 2、若可以正常查询处方,状态为失败,则需要将状态改为失败,并根据处方号重新获取新的处方直到成功为止。

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

@ -1,12 +1,15 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
@ -24,9 +27,15 @@ import java.util.UUID;
@RequestMapping(value = "/job", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "后台-任务控制")
public class JobController extends BaseController {
    private org.slf4j.Logger logger = LoggerFactory.getLogger(JobController.class);
    private final JobService jobService;
    private final QuartzHelper quartzHelper;
    @Autowired
    private InternetService internetService;
    @Autowired
    public JobController(JobService jobService, QuartzHelper quartzHelper) {
        this.jobService = jobService;
@ -198,5 +207,55 @@ public class JobController extends BaseController {
        }
    }
    @RequestMapping(value = "/internetUpload", method = RequestMethod.GET)
    @ApiOperation("监管平台测试")
    public String internetUpload(String taskId) {
        try {
            //1、获取 JOB 执行区间  执行时间点的前一天  时间点定在每天的 00:00:00 执行,同步前一天的数据
            String endDate = DateUtil.dateToStrLong(DateUtil.getNow());
            String startDate = DateUtil.dateToStrLong(DateUtil.getPreDays(DateUtil.getNow(),1));
            String res = "";
            // 2、分步执行需要JOB执行的服务
            logger.info("START========2.3 网上预约挂号上传开始========");
            res = internetService.upNsDoctorRecord(startDate,endDate);
            logger.info("END==========2.3 网上预约挂号上传结束 ========" + res);
            logger.info("START========2.5 网上预约挂号上传开始========");
            res = internetService.upAppointmentOnline(startDate,endDate);
            logger.info("END==========2.5 网上预约挂号上传结束========" + res);
            logger.info("START========2.6 网上医技预约上传开始========");
            res = internetService.upMedicalOnline(startDate,endDate);
            logger.info("END==========2.5 网上医技预约上传结束========" + res);
            logger.info("START========2.7 医生评价信息开始========");
            res = internetService.upNsDoctorScore(startDate,endDate);
            logger.info("END==========2.7 医生评价信息结束========" + res);
            logger.info("START========2.8 网络咨询服务信息开始========");
            res = internetService.upNsOnlineAsk(startDate,endDate);
            logger.info("END==========2.8 网络咨询服务信息结束========" + res);
            logger.info("START========2.9 网络咨询服务信息开始========");
            res = internetService.upNsOnlineMed(startDate,endDate);
            logger.info("END==========2.9 网络咨询服务信息结束========" + res);
            logger.info("START========2.10 电子处方表开始========");
            res = internetService.upPrescription(startDate,endDate);
            logger.info("END==========2.10 电子处方表结束========" + res);
            logger.info("START========2.11 电子处方_药品明细表开始 ========");
            res = internetService.upPrescriptionDrug(startDate,endDate);
            logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
            logger.info("END========InternetUpdateJob 执行结束========");
            return success("success");
        } catch (Exception e) {
            error(e);
            return error(-1, "启动失败");
        }
    }
}