|
|
|
|
@ -154,19 +154,19 @@ public class RxService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 处方订单信息预存 |
|
|
|
|
* [处方]HIS预结算 |
|
|
|
|
* |
|
|
|
|
* @param recipeJson 处方单json数据 |
|
|
|
|
* @param patientId 患者id |
|
|
|
|
* @param treatNum 门诊号 |
|
|
|
|
* @return 是否完成操作 |
|
|
|
|
*/ |
|
|
|
|
public List<Recipe> hisRxPrepay(String recipeJson, String patientId, String treatNum) { |
|
|
|
|
log.info("[处方]预结算 patientId={}, treatNum={}, recipeJson={}", patientId, treatNum, recipeJson); |
|
|
|
|
public List<Recipe> hisRxPrepay(MerchantEnum merchantEnum, String recipeJson, String patientId, String treatNum) { |
|
|
|
|
log.info("[处方]HIS预结算开始... patientId={}, treatNum={}, recipeJson={}", patientId, treatNum, recipeJson); |
|
|
|
|
List<Recipe> respList = new ArrayList<>(); |
|
|
|
|
List<Recipe> recipeList = JsonHelper.parseArray(recipeJson, Recipe.class); |
|
|
|
|
if (recipeList == null || recipeList.isEmpty()) { |
|
|
|
|
log.info("[处方]预结算勾选处方数量为0 或 数据转换失败"); |
|
|
|
|
List<Recipe> rxList = JsonHelper.parseArray(recipeJson, Recipe.class); |
|
|
|
|
if (rxList == null || rxList.isEmpty()) { |
|
|
|
|
log.info("[处方]HIS预结算-勾选处方数量为0 或 数据转换失败"); |
|
|
|
|
return respList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -176,29 +176,28 @@ public class RxService { |
|
|
|
|
String recipeId, feeId, feeInfo; |
|
|
|
|
JsonResult response; |
|
|
|
|
Recipe addInfo; |
|
|
|
|
for (Recipe recipe : recipeList) { |
|
|
|
|
recipeId = recipe.getRecipeId(); |
|
|
|
|
if (ObjectUtils.isEmpty(recipeId) || ObjectUtils.isEmpty(recipe.getRecipeFee())) { |
|
|
|
|
for (Recipe rxItem : rxList) { |
|
|
|
|
recipeId = rxItem.getRecipeId(); |
|
|
|
|
if (ObjectUtils.isEmpty(recipeId) || ObjectUtils.isEmpty(rxItem.getRecipeFee())) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
recipeIds = new ArrayList<>(); |
|
|
|
|
recipeIds.add(recipe.getRecipeId()); |
|
|
|
|
recipeIds.add(rxItem.getRecipeId()); |
|
|
|
|
|
|
|
|
|
response = HisRecipeDao.prepay( |
|
|
|
|
response = HisRecipeDao.rxPrepay( |
|
|
|
|
merchantEnum, |
|
|
|
|
patientId, |
|
|
|
|
treatNum, |
|
|
|
|
recipeIds, |
|
|
|
|
recipe.getRecipeFee().toString(), |
|
|
|
|
rxItem.getRecipeFee().toString(), |
|
|
|
|
curDate, |
|
|
|
|
curTime, |
|
|
|
|
"app", |
|
|
|
|
MerchantEnum.WX); |
|
|
|
|
null); |
|
|
|
|
|
|
|
|
|
log.info("[处方]HIS预结算 resp={}", response); |
|
|
|
|
if (response.success()) { |
|
|
|
|
feeId = response.getDataMapString("FeeID"); |
|
|
|
|
feeInfo = response.getDataMapString("FeeInfo"); |
|
|
|
|
log.info("[处方]预结算成功 treatNum={}, recipeId={}, feeId={}, feeInfo={}", treatNum, recipeId, feeId, feeInfo); |
|
|
|
|
log.info("[处方]HIS预结算成功 treatNum={}, recipeId={}, feeId={}, feeInfo={}", treatNum, recipeId, feeId, feeInfo); |
|
|
|
|
if (feeId != null && feeInfo != null) { |
|
|
|
|
addInfo = new Recipe(); |
|
|
|
|
|
|
|
|
|
@ -208,6 +207,8 @@ public class RxService { |
|
|
|
|
addInfo.setFeeInfo(feeInfo); |
|
|
|
|
respList.add(addInfo); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.error("[处方]HIS预结算失败: {}", JsonHelper.toJsonString(response)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return respList; |
|
|
|
|
@ -288,7 +289,6 @@ public class RxService { |
|
|
|
|
public boolean hisRxListPay(MerchantEnum merchantEnum, String totalFee, String openid, String outTradeNo, String bankTransNo, String bankMerchantNo, String payDate, String payTime, String payInfo) { |
|
|
|
|
RxDao rxDao = new RxDao(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 此处判断是否已经发起缴费,只要已存在数据库记录,说明已经发起了缴费请求,不能根据已经缴费成功,才取消本次缴费请求,因为请求可能已经延时,本次请求可能是重复提交的请求
|
|
|
|
|
if (PayService.hasUserOrderNo(outTradeNo, openid)) { |
|
|
|
|
log.info("{} [处方]已发起缴费 outTradeNo={}", merchantEnum.NAME, outTradeNo); |
|
|
|
|
@ -363,7 +363,7 @@ public class RxService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (MerchantEnum.JY.equals(merchantEnum)) { |
|
|
|
|
new MicroService().uploadRxFee(rxList, failedList.isEmpty(), new BigDecimal(totalFee), false); |
|
|
|
|
new MicroService().uploadRxFee(rxList, outTradeNo, failedList.isEmpty(), new BigDecimal(totalFee), false); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -394,11 +394,10 @@ public class RxService { |
|
|
|
|
String tip = String.format("共计缴费处方单数:%s,失败数:%s,超时数:%s", rxList.size(), (failedList.size() - outTimeList.size()), outTimeList.size()); |
|
|
|
|
log.info("{} [处方]{}", merchantEnum.NAME, tip); |
|
|
|
|
|
|
|
|
|
if (WeChatConfig.APP_ID.equals(HospConfigEnum.红河州第一人民医院.WX_APP_ID)) { |
|
|
|
|
if (HospConfigEnum.红河州第一人民医院.isWxHospEnum()) { |
|
|
|
|
TZReserveConfig.reserveRun(patientId); // 天助医技预约
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new HealthUploadService().rxReportHISData(merchantEnum, openid, patientId); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|