|
@@ -5,15 +5,19 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.wechat.pay.java.service.payments.model.Transaction;
|
|
|
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.wxservice_server.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.wxservice_server.constant.CardCostTypes;
|
|
|
+import thyyxxk.wxservice_server.constant.medins.FundDetail;
|
|
|
import thyyxxk.wxservice_server.dao.InpatientDao;
|
|
|
import thyyxxk.wxservice_server.dao.WxApiDao;
|
|
|
import thyyxxk.wxservice_server.entity.PureCodeName;
|
|
|
import thyyxxk.wxservice_server.entity.ResultVo;
|
|
|
import thyyxxk.wxservice_server.entity.electronichealthcard.HisRegister;
|
|
|
import thyyxxk.wxservice_server.entity.inpatient.GetZyFeeParam;
|
|
|
+import thyyxxk.wxservice_server.entity.paymzfee.MedinsPresettle;
|
|
|
import thyyxxk.wxservice_server.entity.wxapi.PushMessageParam;
|
|
|
import thyyxxk.wxservice_server.entity.wxapi.WxPayOrder;
|
|
|
import thyyxxk.wxservice_server.factory.thmz.ThmzService;
|
|
@@ -39,6 +43,8 @@ public class SavePayResultService {
|
|
|
private final WxRefundService refundService;
|
|
|
private final PushWxMessageService pushWxMessageService;
|
|
|
private final ElectronicHealthCardService healthCardService;
|
|
|
+ @Value("${siMzApiUrl}")
|
|
|
+ private String siMzApiUrl;
|
|
|
|
|
|
@Autowired
|
|
|
public SavePayResultService(WxApiDao dao, InpatientDao yjjDao, ThmzService thmzService, WxRefundService refundService,
|
|
@@ -151,13 +157,30 @@ public class SavePayResultService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "【" + saveMzPayResponse.getMessage() + "】自动退款失败,请联系服务中心进行退款。");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void updateAppletHisChargeplStatus(String hisOrdNum, String tradeNo) {
|
|
|
String[] patinfo = hisOrdNum.split("_");
|
|
|
+ medinsSettle(hisOrdNum);
|
|
|
dao.updateMzSavedFlag(patinfo[0], patinfo[1]);
|
|
|
dao.updateSuccessHisStatus(tradeNo);
|
|
|
}
|
|
|
|
|
|
+ public void medinsSettle(String hisOrdNum) {
|
|
|
+ String[] arr = hisOrdNum.split("_");
|
|
|
+ Double acctPay = dao.selectPreSetlinfo(arr[0], arr[1]);
|
|
|
+ if (null != acctPay) {
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.put("patNo", arr[0]);
|
|
|
+ params.put("times", arr[1]);
|
|
|
+ params.put("staffId", "99999");
|
|
|
+ if (acctPay > 0) {
|
|
|
+ params.put("acctUsedFlag", "1");
|
|
|
+ }
|
|
|
+ String url = siMzApiUrl + "/outpatientSettlement";
|
|
|
+ String response = new RestTemplate().postForObject(url, params, String.class);
|
|
|
+ log.info("患者自助医保结算:\n参数:{}\n结果:{}", params, JSON.toJSON(response));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public ResultVo<Object> saveZyYjjInfo(WxPayOrder order) {
|
|
|
int savedCount = yjjDao.selectSavedCount(order.getTradeNo(), order.getSerialNo());
|
|
|
if (savedCount > 0) {
|