imp: 主管医生从详细接口取住院医师

master
wyb 4 months ago
parent baef72c0a9
commit 01495e52fb

@ -2,12 +2,15 @@ package com.docus.server.collection.httpservices.impl;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.docus.core.util.Func; import com.docus.core.util.Func;
import com.docus.server.collection.dto.TBasicDto; import com.docus.server.collection.dto.TBasicDto;
import com.docus.server.collection.httpservices.HttpTBasicService; import com.docus.server.collection.httpservices.HttpTBasicService;
import com.docus.server.collection.rpc.MzZyyRocCurrWebCommonRpc;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -23,6 +26,8 @@ import java.util.Map;
@Service @Service
@Slf4j @Slf4j
public class HttpTBasicServiceImpl implements HttpTBasicService { public class HttpTBasicServiceImpl implements HttpTBasicService {
@Resource
private MzZyyRocCurrWebCommonRpc mzZyyRocCurrWebCommonRpc;
@Override @Override
public List<TBasicDto> getTBasicDto(String url, Map<String,String> headers, Map<String,Object> params) { public List<TBasicDto> getTBasicDto(String url, Map<String,String> headers, Map<String,Object> params) {
List<TBasicDto> tBasicDtos=null; List<TBasicDto> tBasicDtos=null;
@ -130,10 +135,31 @@ public class HttpTBasicServiceImpl implements HttpTBasicService {
tBasicDto.setInpatientNo(inpatientNo); tBasicDto.setInpatientNo(inpatientNo);
tBasicDto.setDutyNurse(dutyNurse); tBasicDto.setDutyNurse(dutyNurse);
tBasicDto.setMotherInpatientNo(motherInpatientNo); tBasicDto.setMotherInpatientNo(motherInpatientNo);
// 主管医生取另外的接口数据值
setAttending(tBasicDto);
tBasicDtos.add(tBasicDto); tBasicDtos.add(tBasicDto);
} }
return tBasicDtos; return tBasicDtos;
} }
/**
*
*/
private void setAttending(TBasicDto tBasicDto) {
String jzh = tBasicDto.getJzh();
JSONObject patientRes = mzZyyRocCurrWebCommonRpc.getInPatient(jzh);
if (patientRes == null) {
return;
}
boolean success = "200".equals(patientRes.getString("code"));
JSONObject patientData = patientRes.getJSONObject("data");
if (!success || patientData == null) {
return;
}
String houseDocCode = patientData.getString("houseDocCode");
String houseDocName = patientData.getString("houseDocName");
tBasicDto.setAttending(houseDocCode);
tBasicDto.setAttending(houseDocName);
}
} }

@ -15,4 +15,11 @@ public interface MzZyyRocCurrWebCommonRpc {
* @return * @return
*/ */
JSONObject queryDept(String deptCode, String deptType); JSONObject queryDept(String deptCode, String deptType);
/**
*
* @param inpatientNo
* @return
*/
JSONObject getInPatient(String inpatientNo);
} }

@ -47,4 +47,22 @@ public class MzZyyRocCurrWebCommonRpcImpl implements MzZyyRocCurrWebCommonRpc {
return null; return null;
} }
} }
@Override
public JSONObject getInPatient(String inpatientNo) {
final String path = "/api/v1/common/in-patient/get/" + inpatientNo;
final String url = rocCurrWebUrl + path;
try {
String result = HttpUtil.createGet(url)
.header("Content-Type", "application/json")
.header("domain", rocDomain)
.header("key", rocKey)
.timeout(60 * 1000)
.execute().body();
return JSONObject.parseObject(result);
} catch (Exception ex) {
log.error(url + " 请求出错了," + ex.getMessage(), ex);
return null;
}
}
} }

Loading…
Cancel
Save