| | |
| | | } else { |
| | | reMsg = "单次支付未成功,不允许预扣费!"; |
| | | bcode = ConsumptionConstant.BUSINESS_CODE_FAIL; |
| | | isSuccess = false; |
| | | } |
| | | } else { |
| | | //先获取这个业务关联的扣费记录 |
| | |
| | | } else { |
| | | reMsg = "单次支付未成功,不允许扣费!"; |
| | | bcode = ConsumptionConstant.BUSINESS_CODE_FAIL; |
| | | isSuccess=false; |
| | | } |
| | | } else { |
| | | //先获取这个业务关联的扣费记录 |
| | |
| | | //预扣费成功 |
| | | reMsg = "单次支付模拟退还扣费成功!"; |
| | | bcode = ConsumptionConstant.BUSINESS_CODE_RETURN_DEDUCTION; |
| | | isSuccess=true; |
| | | } else { |
| | | reMsg = "单次支付未成功,不允许退扣费!"; |
| | | bcode = ConsumptionConstant.BUSINESS_CODE_FAIL; |
| | |
| | | //预扣费成功 |
| | | reMsg = "单次支付模拟已经扣费成功!"; |
| | | bcode = ConsumptionConstant.BUSINESS_CODE_IS_DEDUCTION; |
| | | isSuccess = true; |
| | | //消息队列通知 |
| | | MessageToBI(consumptionRequest); |
| | | } else { |
| | |
| | | private ProductOrderDetail deductionDepartmentProduct(int consumCount, Long hospitalId, Long departmentId) { |
| | | UserProductDetail userProductDetail = productOrderDetailService.getUserProductDetail(hospitalId, departmentId); |
| | | //合并集合 |
| | | userProductDetail.getProductOrderJoinDetailListShare().addAll(userProductDetail.getProductOrderJoinDetailsListDep()); |
| | | userProductDetail.getProductOrderJoinDetailListShare() |
| | | .addAll(userProductDetail.getProductOrderJoinDetailsListDep()); |
| | | List<ProductOrderJoinDetail> productOrderJoinDetailList = userProductDetail.getProductOrderJoinDetailListShare(); |
| | | if (productOrderJoinDetailList.size() > 0) { |
| | | //合并后按id排序并筛除已用完的套餐 |
| | | List<ProductOrderJoinDetail> productOrderJoinDetailsNewList = productOrderJoinDetailList.stream().filter(f -> f.getAilightCount() >= consumCount).sorted(Comparator.comparing(ProductOrderJoinDetail::getId)).collect(Collectors.toList()); |
| | | List<ProductOrderJoinDetail> productOrderJoinDetailsNewList = productOrderJoinDetailList |
| | | .stream().filter(f -> f.getAilightCount() >= consumCount) |
| | | .sorted(Comparator.comparing(ProductOrderJoinDetail::getId)).collect(Collectors.toList()); |
| | | //要使用的套餐信息 |
| | | ProductOrderDetail productOrderDetail = productOrderDetailService.getById(productOrderJoinDetailsNewList.get(0).getId()); |
| | | return productOrderDetail; |
| | |
| | | private Boolean departmentIsPay(ConsumptionRequest consumptionRequest) { |
| | | log.info("查看当前科室是否开通了单次支付请求参数:"+consumptionRequest.toString()); |
| | | PayManager payManager = payManagerService.findByObject(consumptionRequest.getHospitalId(), consumptionRequest.getDepartmentId()); |
| | | log.info("查看当前科室是否开通了单次支付请求查询后数据:"+payManager.toString()); |
| | | if (payManager == null) { |
| | | return false; |
| | | } else { |
| | |
| | | private Boolean departmentPayStatus(ConsumptionRequest consumptionRequest) { |
| | | log.info("查看当前科室当前诊断id的支付状态是否成功请求参数:"+consumptionRequest.toString()); |
| | | SaasClientPay saasClientPay = saasClientPayService.findModelByObject(consumptionRequest.getHospitalId(), consumptionRequest.getDepartmentId(), consumptionRequest.getDiaId()); |
| | | log.info("查看当前科室当前诊断id的支付状态是否成功查询后数据:"+saasClientPay.toString()); |
| | | if (saasClientPay == null) { |
| | | return false; |
| | | } else { |