|
@ -82,4 +82,64 @@ public class MedicalPayService { |
|
|
return resultMap; |
|
|
return resultMap; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 医保电子凭证解码 |
|
|
|
|
|
*/ |
|
|
|
|
|
public Map<String, Object> decodeEC(String fixmedinsCode, String opter, String opterName){ |
|
|
|
|
|
InDataDto inDataDto = new InDataDto(); |
|
|
|
|
|
inDataDto.setOrgId(fixmedinsCode); |
|
|
|
|
|
inDataDto.setTransType("ec.query"); |
|
|
|
|
|
inDataDto.setExtra(""); |
|
|
|
|
|
EcQueryDto ecQueryDto = EcQueryDto.builder() |
|
|
|
|
|
.orgId(fixmedinsCode) |
|
|
|
|
|
.businessType("02121") |
|
|
|
|
|
.businessInfo("") |
|
|
|
|
|
.operatorId(opter) |
|
|
|
|
|
.operatorName(opterName) |
|
|
|
|
|
.officeId("01") |
|
|
|
|
|
.officeName("内科") |
|
|
|
|
|
.deviceType("") |
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
inDataDto.setData(ecQueryDto); |
|
|
|
|
|
|
|
|
|
|
|
String inData = null; |
|
|
|
|
|
try { |
|
|
|
|
|
inData = JsonUtil.objToJson(inDataDto); |
|
|
|
|
|
} catch (JsonProcessingException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
System.out.println("inData-->"+ inData); |
|
|
|
|
|
Pointer outData = new Memory(1024 * 10); |
|
|
|
|
|
//测试地址 |
|
|
|
|
|
String url = "http://10.103.162.166:8080/localcfc/api/hsecfc/localQrCodeQuery"; |
|
|
|
|
|
//正式地址 |
|
|
|
|
|
//String url = "http://10.103.129.138:8080/localcfc/api/hsecfc/localQrCodeQuery"; |
|
|
|
|
|
String result = NationECLibrary.INSTANCE.NationEcTrans(url, inData, outData); |
|
|
|
|
|
String output = outData.getString(0); |
|
|
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>(3); |
|
|
|
|
|
|
|
|
|
|
|
if (result.equals("0000")){ |
|
|
|
|
|
resultMap.put("status", "200"); |
|
|
|
|
|
System.out.println("outPut-->"+ outData.getString(0)); |
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(outData.getString(0)); |
|
|
|
|
|
if (jsonObject.getIntValue("code") != 0){ |
|
|
|
|
|
resultMap.put("status", "500"); |
|
|
|
|
|
//{"code":-2,"message":"医保电子凭证编码错误,请重新扫码"} |
|
|
|
|
|
String msg = jsonObject.getString("message"); |
|
|
|
|
|
resultMap.put("msg", msg); |
|
|
|
|
|
}else { |
|
|
|
|
|
EcQueryVo ecQueryVo = (EcQueryVo) JSONObject.parseObject(outData.getString(0), EcQueryVo.class); |
|
|
|
|
|
resultMap.put("content", ecQueryVo); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
resultMap.put("status", "500"); |
|
|
|
|
|
resultMap.put("msg", "医保电子凭证异常"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |