|
@ -0,0 +1,61 @@
|
|
|
package com.yihu.jw.hospital.prescription.service.entrance;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.hospital.dzqm.OauthDzqmConfigDO;
|
|
|
import com.yihu.jw.hospital.prescription.dao.OauthDzqmConfigDao;
|
|
|
import com.yihu.utils.network.HttpResponse;
|
|
|
import com.yihu.utils.network.HttpUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
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.Map;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Created by Trick on 2019/10/14.
|
|
|
*/
|
|
|
@Service
|
|
|
@Transactional
|
|
|
public class DoctorPreSignService {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(DoctorPreSignService.class);
|
|
|
|
|
|
@Autowired
|
|
|
private OauthDzqmConfigDao oauthDzqmConfigDao;
|
|
|
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
|
|
|
/**
|
|
|
* 获取医生签名
|
|
|
* @param doctor
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject getDoctorSign(String doctor)throws Exception{
|
|
|
logger.info("getDoctorSign doctor:"+doctor);
|
|
|
BaseDoctorDO doc = doctorDao.findOne(doctor);
|
|
|
|
|
|
OauthDzqmConfigDO dzqmConfigDO = oauthDzqmConfigDao.findOne("base_dzqm");
|
|
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sys",dzqmConfigDO.getSys());
|
|
|
params.put("idNumber",doc.getIdcard());
|
|
|
params.put("idType",0);
|
|
|
params.put("picType",0);
|
|
|
|
|
|
HttpResponse httpResponse = HttpUtils.doGet(dzqmConfigDO.getUrl(),params);
|
|
|
|
|
|
logger.info("getDoctorSign httpResponse:"+httpResponse.getContent());
|
|
|
|
|
|
JSONObject jsonObject = (JSONObject)JSONObject.parse(httpResponse.getContent());
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
}
|