|
|
|
@ -20,6 +20,7 @@ import com.ynxbd.common.result.Result; |
|
|
|
|
import com.ynxbd.common.result.ResultEnum; |
|
|
|
|
import com.ynxbd.common.result.ServiceException; |
|
|
|
|
import com.ynxbd.common.service.cache.PayCache; |
|
|
|
|
import com.ynxbd.wx.config.MeTechnologyReConfig; |
|
|
|
|
import com.ynxbd.wx.utils.DateGenerate; |
|
|
|
|
import com.ynxbd.wx.wxfactory.WxMedicalHelper; |
|
|
|
|
import com.ynxbd.wx.wxfactory.WxPayHelper; |
|
|
|
@ -315,6 +316,15 @@ public class RecipeService { |
|
|
|
|
if (recipeInfo.isRefund()) { |
|
|
|
|
failedList.add(recipeInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果是体检支付就只调用一次his结算
|
|
|
|
|
if(recipeItem.getTreatNum().contains("P-")){ |
|
|
|
|
// 体检缴费失败的所有费用进行退回
|
|
|
|
|
if (recipeInfo.isRefund()) { |
|
|
|
|
failedList = recipeList; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
long endTime = System.currentTimeMillis(); // 结束时间
|
|
|
|
|
log.info("{} [处方]请求HIS结束 耗时:{} outTradeNo={}, bankTransNo={}", merchantEnum.NAME, ((endTime - begTime) / 1000) + "s(" + (endTime - begTime) + "ms)", outTradeNo, bankTransNo); |
|
|
|
@ -347,10 +357,12 @@ public class RecipeService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String tip = String.format("共计缴费处方单数:%s,失败数:%s,超时数:%s", recipeList.size(), (failedList.size() - outTimeList.size()), outTimeList.size()); |
|
|
|
|
log.info("{} [处方]{}", merchantEnum.NAME, tip); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MeTechnologyReConfig.reserveRun(patientId); //天助医技预约
|
|
|
|
|
|
|
|
|
|
HCodeService.payNotifyReportHISData(openid, patientId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -373,6 +385,7 @@ public class RecipeService { |
|
|
|
|
String patientId = recipe.getPatientId(); |
|
|
|
|
String bankTransNo = recipe.getBankTransNo(); |
|
|
|
|
BigDecimal recipeFee = recipe.getPayMoney(); |
|
|
|
|
BigDecimal totalFee = recipe.getTotalFee(); |
|
|
|
|
|
|
|
|
|
order.setUpdateTime(recipe.getUpdateTime()); |
|
|
|
|
String tradeNo = recipe.getTradeNo(); |
|
|
|
@ -397,6 +410,7 @@ public class RecipeService { |
|
|
|
|
treatNum, |
|
|
|
|
recipeIds, |
|
|
|
|
recipeFee.toString(), |
|
|
|
|
totalFee.toString(), |
|
|
|
|
payDate, |
|
|
|
|
payTime, |
|
|
|
|
tradeNo, |
|
|
|
@ -445,11 +459,20 @@ public class RecipeService { |
|
|
|
|
QuickDrugDispenseHelper.quickDrug(drugInfo, invoiceTransNo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新支付信息
|
|
|
|
|
if (!recipeDao.updateHisPaidByTradeNo(tradeNo, hisTransNo, invoiceTransNo)) { |
|
|
|
|
log.info("[处方]更新HIS返回数据失败 outTradeNo={}, tradeNo={}, recipeId={}", outTradeNo, tradeNo, recipeId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果是体检支付就更新所有处方
|
|
|
|
|
if(treatNum.contains("P-")){ |
|
|
|
|
// 更新支付信息
|
|
|
|
|
if (!recipeDao.updateHisPaidByBankTransNo(bankTransNo, hisTransNo, invoiceTransNo)) { |
|
|
|
|
log.info("[处方]更新体检缴费HIS返回数据失败 outTradeNo={}, bankTransNo={}, recipeId={}", outTradeNo, bankTransNo, recipeId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (new SelfHelpDao().updateNotice(treatNum)) { |
|
|
|
|
log.info("[自助开单]通知状态修改成功 treatNum={}", treatNum); |
|
|
|
|
} |
|
|
|
|