|
|
|
@ -4,10 +4,13 @@ import cn.hutool.http.HttpRequest;
|
|
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
import com.docus.core.util.DateUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.web.api.CommonResult;
|
|
|
|
|
import com.docus.server.report.api.ShunDePeopleService;
|
|
|
|
|
import com.docus.server.report.api.dto.*;
|
|
|
|
|
import com.docus.server.report.api.vo.SdRyBloodReportVO;
|
|
|
|
|
import com.docus.server.report.client.JaxWsDynamicClient;
|
|
|
|
|
import com.docus.server.report.config.SdRyReportQueryConfig;
|
|
|
|
|
import com.docus.server.report.util.IdUtil;
|
|
|
|
@ -154,23 +157,24 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
SdNurseInsertSugarRequest request=new SdNurseInsertSugarRequest("10086","1","nur");
|
|
|
|
|
SdNurseInsertSugarRequest request = new SdNurseInsertSugarRequest("10086", "1", "nur");
|
|
|
|
|
String requestParam = Func.toJson(request);
|
|
|
|
|
System.out.println(requestParam);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SdNurseInsertSugarResponse getNurseInsertSugarReport(SdNurseInsertSugarRequest request) {
|
|
|
|
|
String randomUuid = Func.randomUUID();
|
|
|
|
|
NURSE_INSERT_SUGAR_LOCK.lock();
|
|
|
|
|
try {
|
|
|
|
|
String requestParam = Func.toJson(request);
|
|
|
|
|
log.info("[{}]查询移动护理,请求地址:{},参数:{}", randomUuid,sdRyReportQueryConfig.getReportQueryNurseInsertSugarUrl(), requestParam);
|
|
|
|
|
log.info("[{}]查询移动护理,请求地址:{},参数:{}", randomUuid, sdRyReportQueryConfig.getReportQueryNurseInsertSugarUrl(), requestParam);
|
|
|
|
|
String respBody = sendPost(sdRyReportQueryConfig.getReportQueryNurseInsertSugarUrl(), requestParam);
|
|
|
|
|
log.info("[{}]查询移动护理,响应:{}", randomUuid, respBody);
|
|
|
|
|
TimeUnit.MILLISECONDS.sleep(sdRyReportQueryConfig.getReportQueryNurseInsertSugarInterval());
|
|
|
|
|
return JSON.parseObject(respBody,SdNurseInsertSugarResponse.class);
|
|
|
|
|
return JSON.parseObject(respBody, SdNurseInsertSugarResponse.class);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("["+randomUuid+"]"+"查询移动护理出错了:" + ex.getMessage(), ex);
|
|
|
|
|
log.error("[" + randomUuid + "]" + "查询移动护理出错了:" + ex.getMessage(), ex);
|
|
|
|
|
return new SdNurseInsertSugarResponse();
|
|
|
|
|
} finally {
|
|
|
|
|
NURSE_INSERT_SUGAR_LOCK.unlock();
|
|
|
|
@ -182,20 +186,37 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
|
|
|
|
|
String randomUuid = Func.randomUUID();
|
|
|
|
|
NURSE_INSERT_SUGAR_PUSH_ERR_LOCK.lock();
|
|
|
|
|
try {
|
|
|
|
|
String body=Func.toJson(request);
|
|
|
|
|
log.info("[{}] 移动护理推送错误,请求地址:{},参数:{}", randomUuid,sdRyReportQueryConfig.getReportQueryNurseInsertSugarErrPushUrl(), body);
|
|
|
|
|
String body = Func.toJson(request);
|
|
|
|
|
log.info("[{}] 移动护理推送错误,请求地址:{},参数:{}", randomUuid, sdRyReportQueryConfig.getReportQueryNurseInsertSugarErrPushUrl(), body);
|
|
|
|
|
String respBody = sendPost(sdRyReportQueryConfig.getReportQueryNurseInsertSugarErrPushUrl(), body);
|
|
|
|
|
log.info("[{}] 移动护理推送错误,响应:{}", randomUuid, respBody);
|
|
|
|
|
TimeUnit.MILLISECONDS.sleep(sdRyReportQueryConfig.getReportQueryNurseInsertSugarErrPushInterval());
|
|
|
|
|
return JSON.parseObject(respBody,SdNurDocFailResponse.class);
|
|
|
|
|
}catch (Exception ex){
|
|
|
|
|
log.error("["+randomUuid+"]"+"移动护理推送异常,出错了:" + ex.getMessage(), ex);
|
|
|
|
|
return JSON.parseObject(respBody, SdNurDocFailResponse.class);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("[" + randomUuid + "]" + "移动护理推送异常,出错了:" + ex.getMessage(), ex);
|
|
|
|
|
return null;
|
|
|
|
|
}finally {
|
|
|
|
|
} finally {
|
|
|
|
|
NURSE_INSERT_SUGAR_PUSH_ERR_LOCK.unlock();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public CommonResult<List<SdRyBloodReportVO>> getBloodView(String inpatientNo, Integer admissTimes) {
|
|
|
|
|
String rqId = Func.randomUUID();
|
|
|
|
|
String url = sdRyReportQueryConfig.getBloodUrl() + "?inpatientNo=" + inpatientNo + "&admissTimes=" + admissTimes;
|
|
|
|
|
try {
|
|
|
|
|
log.info("[{}]查询血液报告地址:{}", rqId, url);
|
|
|
|
|
String resp = HttpUtil.get(url);
|
|
|
|
|
log.info("[{}]查询血液报告结果:{}", rqId, resp);
|
|
|
|
|
return JSON.parseObject(resp, new TypeReference<CommonResult<List<SdRyBloodReportVO>>>() {
|
|
|
|
|
});
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("[" + rqId + "]" + "查询血液报告出错了:" + ex.getMessage(), ex);
|
|
|
|
|
return CommonResult.failed("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String organizationQuerySdRyInspectReportUrl(String reportQueryLisUrl) {
|
|
|
|
|
return reportQueryLisUrl + "/query?uuid=" + IdUtil.standardUUID() +
|
|
|
|
|
"&action=" + sdRyReportQueryConfig.getReportQueryInspectAction() +
|
|
|
|
|