|
|
|
@ -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("订单未找到"); |
|
|
|
|