支付宝医保正式环境和微信医保正式环境使用的参数和调用地址不一致,为此进行调用链接的调整

debug
王绍全 3 days ago
parent 753edfcd0f
commit 48aac4098b
  1. 4
      src/main/java/com/ynxbd/ali/helper/AliMedHelper.java
  2. 4
      src/main/java/com/ynxbd/common/action/InHospAction.java
  3. 43
      src/main/java/com/ynxbd/common/action/pay/MedicalTestAction.java
  4. 4
      src/main/java/com/ynxbd/common/service/MedicalService.java
  5. 42
      src/main/java/com/ynxbd/wx/wxfactory/medical/Client.java

@ -99,7 +99,7 @@ public class AliMedHelper {
request.putOtherTextParam("auth_token", accessToken);
int callNum = ObjectUtils.isEmpty(reqBizNo) ? 1 : 2; // 2为第二次授权
// [支付宝医保]测试报告2
// [支付宝医保]测试报告1
log.info("[支付宝医保]身份核验信息授权查询接口[{}]-入参{}", callNum, JsonHelper.toJsonString(request));
AlipayCommerceMedicalAuthinfoAuthQueryResponse response = alipayClient.execute(request);
log.info("[支付宝医保]身份核验信息授权查询接口[{}]-调用{} {}", callNum, response.isSuccess() ? "[成功]" : "[失败]", response.getBody());
@ -208,7 +208,7 @@ public class AliMedHelper {
bizContent.put("extend_params", extendParams);
request.setBizContent(JSONObject.toJSONString(bizContent));
// [支付宝医保]测试报告3
log.info("[支付宝医保]下单-入参 {}", JSONObject.toJSONString(request));
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
log.info("[支付宝医保]下单-返回 orderStr={}", response.getBody());

@ -5,6 +5,7 @@ import com.ynxbd.common.bean.in_hosp.*;
import com.ynxbd.common.config.interceptor.AesDecode;
import com.ynxbd.common.dao.his.HisInHospDao;
import com.ynxbd.common.helper.common.DateHelper;
import com.ynxbd.common.helper.common.JsonHelper;
import com.ynxbd.common.result.JsonResult;
import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum;
@ -113,12 +114,14 @@ public class InHospAction extends BaseAction {
}
JsonResult resp = new HisInHospDao().getInHospFee(patientId, date);
log.error("[getInHospFee] resp={}", JsonHelper.toJsonString(resp));
if (!resp.success()) {
return Result.error(resp.getMessage());
}
InHospFee inHospFee = new InHospFee();
List<InHospFeeItem> items = resp.getDataMapList(InHospFeeItem.class, "Item");
log.error("[getInHospFee] items={}", JsonHelper.toJsonString(items));
items.forEach(item -> {
BigDecimal price = item.getPrice();
Integer count = item.getCount();
@ -135,7 +138,6 @@ public class InHospAction extends BaseAction {
inHospFee.setAttendingPhysician(resp.getDataMapString("setAttendingPhysician"));
inHospFee.setLengthOfStay(resp.getDataMapString("LengthOfStay"));
inHospFee.setTotalHospitalization(resp.getDataMapBigDecimal("TotalHospitalization"));
return Result.success(inHospFee);
}

@ -2,7 +2,6 @@ package com.ynxbd.common.action.pay;
import com.alibaba.fastjson.JSONObject;
import com.ynxbd.ali.config.AliMedConfig;
import com.ynxbd.ali.helper.AliMedHelper;
import com.ynxbd.common.action.base.BaseAction;
import com.ynxbd.common.bean.HisRecipe;
import com.ynxbd.common.bean.enums.MerchantEnum;
@ -47,8 +46,12 @@ public class MedicalTestAction extends BaseAction {
* 获取未缴费项目
*/
@Action("getDevRxUnPayList")
public Result getDevRxUnPayList(@AesDecode String patientId, String begDate, String endDate) {
log.info("[处方Dev]未缴费项目查询 patientId={}, begDate={}, endDate={}", patientId, begDate, endDate);
public Result getDevRxUnPayList(@AesDecode String patientId, String payCode, String begDate, String endDate) {
log.info("[处方Dev]未缴费项目查询 payCode={}, patientId={}, begDate={}, endDate={}", payCode, patientId, begDate, endDate);
MerchantEnum merchantEnum = MerchantEnum.findEnumByCode(payCode);
if (merchantEnum == null) {
return Result.error(ResultEnum.PAY_TYPE_ERROR);
}
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -58,7 +61,7 @@ public class MedicalTestAction extends BaseAction {
}
int days = DateHelper.intervalDays(begDate, endDate, true);
List<HisRecipe> hisRecipes = HisMedTestDao.devUnPayList(patientId, days);
List<HisRecipe> hisRecipes = HisMedTestDao.devUnPayList(merchantEnum, patientId, days);
List<HisRecipe> dataList = new ArrayList<>();
for (HisRecipe hisRecipe : hisRecipes) {
@ -74,8 +77,12 @@ public class MedicalTestAction extends BaseAction {
* 获取未缴费项目
*/
@Action("getDevRxPaidList")
public Result getDevRxPaidList(@AesDecode String patientId, String begDate, String endDate) {
log.info("[处方Dev]已缴费项目查询 patientId={}, begDate={}, endDate={}", patientId, begDate, endDate);
public Result getDevRxPaidList(@AesDecode String patientId, String payCode, String begDate, String endDate) {
log.info("[处方Dev]已缴费项目查询 payCode={}, patientId={}, begDate={}, endDate={}", payCode, patientId, begDate, endDate);
MerchantEnum merchantEnum = MerchantEnum.findEnumByCode(payCode);
if (merchantEnum == null) {
return Result.error(ResultEnum.PAY_TYPE_ERROR);
}
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -83,7 +90,7 @@ public class MedicalTestAction extends BaseAction {
return Result.error("环境错误");
}
List<HisRecipe> hisRecipeList = HisMedTestDao.devPaidRecipeList(patientId, begDate, endDate);
List<HisRecipe> hisRecipeList = HisMedTestDao.devPaidRecipeList(merchantEnum, patientId, begDate, endDate);
return Result.success(new RecipeService().filterPaidList(hisRecipeList));
}
@ -144,8 +151,12 @@ public class MedicalTestAction extends BaseAction {
*
*/
@Action("his_med_refund")
public Result his_med_refund(String payAuthNo, String tradeNo) {
log.info("[医保]HIS退费 payAuthNo={}, tradeNo={}", payAuthNo, tradeNo);
public Result his_med_refund(String payCode, String payAuthNo, String tradeNo) {
log.info("[医保]HIS退费 payCode={}, payAuthNo={}, tradeNo={}", payCode, payAuthNo, tradeNo);
MerchantEnum merchantEnum = MerchantEnum.findEnumByCode(payCode);
if (merchantEnum == null) {
return Result.error(ResultEnum.PAY_TYPE_ERROR);
}
if (ObjectUtils.isEmpty(payAuthNo) || ObjectUtils.isEmpty(tradeNo)) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
@ -162,28 +173,32 @@ public class MedicalTestAction extends BaseAction {
String bankTransNo = recipe.getBankTransNo();
BigDecimal cashFee = recipe.getPayMoney();
JsonResult jsonResult = HisMedDao.medRefund(MerchantEnum.ALI_MEDICAL, payAuthNo, chrgBchno.substring(1), bankTransNo, ("R" + tradeNo), cashFee);
JsonResult jsonResult = HisMedDao.medRefund(merchantEnum, payAuthNo, chrgBchno.substring(1), bankTransNo, ("R" + tradeNo), cashFee);
return Result.success(jsonResult);
}
@Action("wx_med_refund_test")
public Result wx_med_refund_test() throws ServiceException {
WxMedHelper.refundCash("", "", new BigDecimal(""), "人工退费");
// WxMedHelper.refundCash("", "", new BigDecimal(""), "人工退费");
return Result.success();
}
@Action("ali_med_refund_test")
public Result ali_med_refund_test() throws Exception {
AliMedHelper.refundTrade("", "", null, new BigDecimal(""), "医保退费");
// AliMedHelper.refundTrade("", "", null, new BigDecimal(""), "医保退费");
return Result.success();
}
@Action("wx_med_add_order")
public Result wx_med_add_order(String outTradeNo) {
public Result wx_med_add_order(String payCode, String outTradeNo) {
try {
log.info("[医保]补充订单数据 outTradeNo={}", outTradeNo);
log.info("[医保]补充订单数据 payCode={}, outTradeNo={}", payCode, outTradeNo);
MerchantEnum merchantEnum = MerchantEnum.findEnumByCode(payCode);
if (merchantEnum == null) {
return Result.error(ResultEnum.PAY_TYPE_ERROR);
}
WxMedOrder order = WxMedHelper.queryOrder(WxCacheHelper.getAccessToken(), outTradeNo, null);
if (order == null || !order.isOk()) {
return Result.error("订单未找到");

@ -115,11 +115,13 @@ public class MedicalService {
}
// 测试报告内容[2]
log.info("{}[HIS医保上传明细] req={patientId:{}, treatNum={}, totalFee:{}, cardNo:{}, recipeJson:{}}", merchantEnum.NAME, patientId, treatNum, totalFee, cardNo, recipeJson);
log.info("{}[HIS医保上传明细] req={patientId:\"{}\", treatNum:\"{}\", totalFee:\"{}\", cardNo:\"{}\", recipeJson:\"{}\"}", merchantEnum.NAME, patientId, treatNum, totalFee, cardNo, recipeJson);
JsonResult result = HisMedDao.rxMedUploadDetails(merchantEnum, payAuthNo, cardNo, openid, patientId, treatNum, recipeJson, totalFee, ybAttrib, ybBZCode, ybBZName);
return hisMedPlaceOrder(merchantEnum, payAuthNo, result);
}
/**
* [医保]his下单
*

@ -40,27 +40,27 @@ public class Client {
/**
* 微信医保下单
*
* @param OrderMIEnum 订单类型
* @param accessToken accessToken
* @param appId appId
* @param mchId mchId
* @param mdPayKey mdPayKey
* @param cityCode 城市编码
* @param hospitalName 医院名称
* @param orgNo orgNo
* @param channel channel
* @param openid openid
* @param payAuthNo 医保授权码
* @param payOrdId 医保订单id
* @param outTradeNo 商户订单号
* @param serialNo serialNo
* @param totalFee totalFee
* @param insuranceFee insuranceFee
* @param cardNo 证件号码
* @param realName 真实姓名
* @param notifyUrl 通知地址
* @param callbackUrl 回调地址
* @param body body
* @param OrderMIEnum 订单类型
* @param accessToken accessToken
* @param appId appId
* @param mchId mchId
* @param mdPayKey mdPayKey
* @param cityCode 城市编码
* @param hospitalName 医院名称
* @param orgNo orgNo
* @param channel channel
* @param openid openid
* @param payAuthNo 医保授权码
* @param payOrdId 医保订单id
* @param outTradeNo 商户订单号
* @param serialNo serialNo
* @param totalFee totalFee
* @param insuranceFee insuranceFee
* @param cardNo 证件号码
* @param realName 真实姓名
* @param notifyUrl 通知地址
* @param callbackUrl 回调地址
* @param body body
* @return MedicalPayOrder
*/
public MedicalPayOrder createOrder(OrderMIEnum OrderMIEnum, String accessToken,

Loading…
Cancel
Save