|
@ -34,7 +34,7 @@ import java.util.UUID;
|
|
public class MultipleCodeService {
|
|
public class MultipleCodeService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private static OauthYlzConfigDao oauthYlzConfigDao;
|
|
|
|
|
|
private OauthYlzConfigDao oauthYlzConfigDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private BasePatientDao basePatientDao;
|
|
private BasePatientDao basePatientDao;
|
|
@ -174,7 +174,7 @@ public class MultipleCodeService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
// 获取展码地址
|
|
// 获取展码地址
|
|
public static String mcfGetCodeUrl(String ehealth_card_id) throws Exception {
|
|
|
|
|
|
public String mcfGetCodeUrl(String ehealth_card_id) throws Exception {
|
|
OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
|
|
OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
|
|
TransRequest request = new TransRequest();
|
|
TransRequest request = new TransRequest();
|
|
request.setMethod("ehc.ehealthcard.getCodeUrl");
|
|
request.setMethod("ehc.ehealthcard.getCodeUrl");
|
|
@ -204,7 +204,7 @@ public class MultipleCodeService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
//通过身边证查询用户信息
|
|
//通过身边证查询用户信息
|
|
public TransResponse mcfQueryInfo(String idType,String ID) throws Exception {
|
|
|
|
|
|
public String mcfQueryInfo(BasePatientDO patientDO) throws Exception {
|
|
OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
|
|
OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
|
|
TransRequest request = new TransRequest();
|
|
TransRequest request = new TransRequest();
|
|
request.setMethod("ehc.ehealthcard.queryInfo");
|
|
request.setMethod("ehc.ehealthcard.queryInfo");
|
|
@ -216,12 +216,65 @@ public class MultipleCodeService {
|
|
request.setEnc_type("Plain");
|
|
request.setEnc_type("Plain");
|
|
JSONObject bizContent = new JSONObject();
|
|
JSONObject bizContent = new JSONObject();
|
|
String no = UUID.randomUUID().toString();
|
|
String no = UUID.randomUUID().toString();
|
|
bizContent.put("id_type", idType);
|
|
|
|
bizContent.put("id_no", ID);
|
|
|
|
|
|
bizContent.put("id_type", "01");
|
|
|
|
bizContent.put("id_no", patientDO.getIdcard());
|
|
request.setBiz_content(JSONObject.toJSONString(bizContent));
|
|
request.setBiz_content(JSONObject.toJSONString(bizContent));
|
|
EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcService/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
|
|
EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcService/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
|
|
TransResponse re = ehcHandler.execute(request);
|
|
TransResponse re = ehcHandler.execute(request);
|
|
return re;
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
if ((JSONObject.parseObject(re.getRet_code()).toJSONString()).equalsIgnoreCase("0000")){
|
|
|
|
patientDO.setRegister("1");
|
|
|
|
String idCard = JSONObject.parseObject(re.getBiz_content()).getString("id_no");
|
|
|
|
if (idCard!=null)
|
|
|
|
{
|
|
|
|
patientDO.setIdcard(idCard);
|
|
|
|
}
|
|
|
|
String userName = JSONObject.parseObject(re.getBiz_content()).getString("user_name");
|
|
|
|
if (userName!=null)
|
|
|
|
{
|
|
|
|
patientDO.setName(userName);
|
|
|
|
}
|
|
|
|
String userSex = JSONObject.parseObject(re.getBiz_content()).getString("user_sex");
|
|
|
|
if (userSex!=null){
|
|
|
|
patientDO.setSex(Integer.valueOf(userName));
|
|
|
|
}
|
|
|
|
String mobilePhone = JSONObject.parseObject(re.getBiz_content()).getString("mobile_phone");
|
|
|
|
if (mobilePhone!=null){
|
|
|
|
patientDO.setMobile(mobilePhone);
|
|
|
|
}
|
|
|
|
String birthday = JSONObject.parseObject(re.getBiz_content()).getString("birthday");
|
|
|
|
if (birthday!=null){
|
|
|
|
patientDO.setBirthday(DateUtil.strToDate(birthday));
|
|
|
|
}
|
|
|
|
String telephone = JSONObject.parseObject(re.getBiz_content()).getString("telephone");
|
|
|
|
if (telephone!=null){
|
|
|
|
patientDO.setPhone(telephone);
|
|
|
|
}
|
|
|
|
String address = JSONObject.parseObject(re.getBiz_content()).getString("address");
|
|
|
|
if (address!=null){
|
|
|
|
patientDO.setAddress(address);
|
|
|
|
}
|
|
|
|
basePatientDao.save(patientDO);
|
|
|
|
jsonObject.put("register","1");
|
|
|
|
String ehealthCardId = JSONObject.parseObject(re.getBiz_content()).getString("ehealth_card_id");
|
|
|
|
WlyyHttpLogDO logDO = new WlyyHttpLogDO();
|
|
|
|
logDO.setCode("ehc.ehealthcard.getCodeUr");
|
|
|
|
logDO.setName("获取多码融合展示码");
|
|
|
|
logDO.setPatient(patientDO.getId());
|
|
|
|
logDO.setRequest("ehealthCardId="+ehealthCardId);
|
|
|
|
String codeUrl = mcfGetCodeUrl(ehealthCardId);
|
|
|
|
if (codeUrl!=null){
|
|
|
|
logDO.setResponse(codeUrl);
|
|
|
|
logDO.setStatus("0");
|
|
|
|
logDO.setCreateTime(DateUtil.getNowDate());
|
|
|
|
wlyyHttpLogDao.save(logDO);
|
|
|
|
jsonObject.put("codeUrl",codeUrl);
|
|
|
|
return codeUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
public MixEnvelop mcfQueryInfo(String ehealth_card_id ) throws Exception {
|
|
public MixEnvelop mcfQueryInfo(String ehealth_card_id ) throws Exception {
|