|
|
@@ -20,8 +20,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -43,46 +41,46 @@ public class TsmzServiceImpl implements TsmzService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo,Integer acctUsedFlag) {
|
|
|
- log.info("调用医保试算接口,操作人={},病人={},就诊次数={},缴费次数={},是否用个账={}", staffId, patientId, times, receiptNo,acctUsedFlag == null ? 0 : acctUsedFlag);
|
|
|
- String realUrl = tsmzServiceUrl + "/uploadFees";
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- //Map 对象存入 用户名,密码,电话号码
|
|
|
- map.put("staffId", staffId);
|
|
|
- map.put("patientId", patientId);
|
|
|
- map.put("times", times);
|
|
|
- map.put("receiptNo", receiptNo);
|
|
|
- map.put("acctUsedFlag", acctUsedFlag == null ? 0 : acctUsedFlag);
|
|
|
- //Map 转成 JSONObject 字符串
|
|
|
- JSONObject jsonObj = new JSONObject(map);
|
|
|
- try {
|
|
|
- String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 6000);
|
|
|
- if (StringUtils.isBlank(result)) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- JSONObject resultJSONO = new JSONObject(result);
|
|
|
- if (resultJSONO == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if ((int) resultJSONO.get("code") == 0) {
|
|
|
- return getPayInfo(resultJSONO);
|
|
|
- } else if ((int) resultJSONO.get("code") == -1) {
|
|
|
- PayInfo payInfo = new PayInfo();
|
|
|
- payInfo.setCode(-1);
|
|
|
- payInfo.setErrorMessage((String) resultJSONO.get("msg"));
|
|
|
- return payInfo;
|
|
|
- } else if ((int) resultJSONO.get("code") == -2) {
|
|
|
- PayInfo payInfo = new PayInfo();
|
|
|
- payInfo.setCode(-2);
|
|
|
- payInfo.setErrorMessage((String) resultJSONO.get("msg"));
|
|
|
- return payInfo;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(StrUtil.format("特殊门诊病人费用试算失败,病人id={},就诊次数times={},缴费次数receiptNo={}:异常信息", patientId, times, receiptNo),e);
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo,Integer acctUsedFlag) {
|
|
|
+// log.info("调用医保试算接口,操作人={},病人={},就诊次数={},缴费次数={},是否用个账={}", staffId, patientId, times, receiptNo,acctUsedFlag == null ? 0 : acctUsedFlag);
|
|
|
+// String realUrl = tsmzServiceUrl + "/uploadFees";
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
+// //Map 对象存入 用户名,密码,电话号码
|
|
|
+// map.put("staffId", staffId);
|
|
|
+// map.put("patientId", patientId);
|
|
|
+// map.put("times", times);
|
|
|
+// map.put("receiptNo", receiptNo);
|
|
|
+// map.put("acctUsedFlag", acctUsedFlag == null ? 0 : acctUsedFlag);
|
|
|
+// //Map 转成 JSONObject 字符串
|
|
|
+// JSONObject jsonObj = new JSONObject(map);
|
|
|
+// try {
|
|
|
+// String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 6000);
|
|
|
+// if (StringUtils.isBlank(result)) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// JSONObject resultJSONO = new JSONObject(result);
|
|
|
+// if (resultJSONO == null) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if ((int) resultJSONO.get("code") == 0) {
|
|
|
+// return getPayInfo(resultJSONO);
|
|
|
+// } else if ((int) resultJSONO.get("code") == -1) {
|
|
|
+// PayInfo payInfo = new PayInfo();
|
|
|
+// payInfo.setCode(-1);
|
|
|
+// payInfo.setErrorMessage((String) resultJSONO.get("msg"));
|
|
|
+// return payInfo;
|
|
|
+// } else if ((int) resultJSONO.get("code") == -2) {
|
|
|
+// PayInfo payInfo = new PayInfo();
|
|
|
+// payInfo.setCode(-2);
|
|
|
+// payInfo.setErrorMessage((String) resultJSONO.get("msg"));
|
|
|
+// return payInfo;
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error(StrUtil.format("特殊门诊病人费用试算失败,病人id={},就诊次数times={},缴费次数receiptNo={}:异常信息", patientId, times, receiptNo),e);
|
|
|
+// }
|
|
|
+// return null;
|
|
|
+// }
|
|
|
|
|
|
private PayInfo getPayInfo(JSONObject resultJSONO) {
|
|
|
JSONObject tempJSONO = (JSONObject) resultJSONO.get("payInfo");
|
|
|
@@ -144,15 +142,16 @@ public class TsmzServiceImpl implements TsmzService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PayInfo calculateCost(String staffId, String patientId, Integer times, Integer receiptNo) {
|
|
|
+ public PayInfo calculateCost(String staffId, String patientId, Integer times, Integer receiptNo, Integer acctUsedFlag) {
|
|
|
String realUrl = tsmzServiceUrl + "/calculateCost";
|
|
|
- log.info("调用医保上传接口,操作人={},病人={},就诊次数={},缴费次数={}", staffId, patientId, times, receiptNo);
|
|
|
+ log.info("调用医保结算接口,操作人={},病人={},就诊次数={},缴费次数={},使用个账={}", staffId, patientId, times, receiptNo, acctUsedFlag);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
//Map 对象存入 用户名,密码,电话号码
|
|
|
map.put("staffId", staffId);
|
|
|
map.put("patientId", patientId);
|
|
|
map.put("times", times);
|
|
|
map.put("receiptNo", receiptNo);
|
|
|
+ map.put("acctUsedFlag", acctUsedFlag);
|
|
|
//Map 转成 JSONObject 字符串
|
|
|
JSONObject jsonObj = new JSONObject(map);
|
|
|
try {
|