|
@@ -4,11 +4,11 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
-import thyyxxk.webserver.constants.ExternalAddr;
|
|
|
import thyyxxk.webserver.dao.his.mzpayqrcode.MzPayQrcodeDao;
|
|
|
import thyyxxk.webserver.entity.HrgResponse;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
@@ -28,6 +28,8 @@ import java.util.Map;
|
|
|
public class MzPayQrcodeService {
|
|
|
private final MzPayQrcodeDao dao;
|
|
|
private static final int MIN_PATIENT_ID_LENGTH = 7;
|
|
|
+ @Value("${hrg-api-url}")
|
|
|
+ private String hrgApiUrl;
|
|
|
|
|
|
@Autowired
|
|
|
public MzPayQrcodeService(MzPayQrcodeDao dao) {
|
|
@@ -40,7 +42,7 @@ public class MzPayQrcodeService {
|
|
|
obj.put("patIdType", 11);
|
|
|
obj.put("patIdNo", socialNo);
|
|
|
RestTemplate template = new RestTemplate();
|
|
|
- return template.postForObject(ExternalAddr.QUERY_PATIENT_INFO, obj, PatInfo.class);
|
|
|
+ return template.postForObject(hrgApiUrl + "/queryPatientInfo", obj, PatInfo.class);
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Map<String, String>>> getRoughList(String patientId) {
|
|
@@ -53,7 +55,7 @@ public class MzPayQrcodeService {
|
|
|
obj.put("patCardNo", patientId);
|
|
|
obj.put("hisOrdNum", "");
|
|
|
RestTemplate template = new RestTemplate();
|
|
|
- HrgResponse hrgRes = template.postForObject(ExternalAddr.GET_MZ_CHARGE_DETAIL_FOR_UN_PAID, obj, HrgResponse.class);
|
|
|
+ HrgResponse hrgRes = template.postForObject(hrgApiUrl + "/getMzChargeDetailForUnPaid", obj, HrgResponse.class);
|
|
|
if (null == hrgRes || null == hrgRes.getResultCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
|
|
|
}
|
|
@@ -78,7 +80,7 @@ public class MzPayQrcodeService {
|
|
|
pObj.put("patCardNo", param.getPatientId());
|
|
|
pObj.put("hisOrdNum", param.getHisOrdNum());
|
|
|
RestTemplate template = new RestTemplate();
|
|
|
- HrgResponse hrgRes = template.postForObject(ExternalAddr.GET_CHARGE_DETAIL_BY_HIS_ORD_NUM, pObj, HrgResponse.class);
|
|
|
+ HrgResponse hrgRes = template.postForObject(hrgApiUrl + "/getChargeDetailByHisOrdNum", pObj, HrgResponse.class);
|
|
|
if (null == hrgRes || null == hrgRes.getResultCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
|
|
|
}
|
|
@@ -89,7 +91,7 @@ public class MzPayQrcodeService {
|
|
|
JSONObject retObj = new JSONObject();
|
|
|
retObj.put("list", makeSimpleData(list));
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
- ResultVo<String> qrResult = restTemplate.postForObject(ExternalAddr.GEN_MZ_PAY_QRCODE, param, ResultVo.class);
|
|
|
+ ResultVo<String> qrResult = restTemplate.postForObject(hrgApiUrl + "/genMzPayQrcode", param, ResultVo.class);
|
|
|
if (null == qrResult || qrResult.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请求微信支付二维码失败,请联系管理员。");
|
|
|
}
|