| | |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 1, orderMoney, null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error("支付失败"); |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | if(payType == 2) {//银行卡支付 |
| | |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 2, orderMoney, null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error("支付失败"); |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | if(payType == 3){//余额支付 |
| | |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0); |
| | | } |
| | | }).start(); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功完成小件物流订单支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully used the balance to complete the small logistics order payment, thank you for using!" |
| | | : "Vous avez utilisé le solde pour compléter avec succès le paiement de la commande logistique de petites pièces. Merci d’utiliser!", uid, 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成小件物流订单支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the small parts logistics order payment, thank you for using!" : |
| | | "Vous avez complété avec succès le paiement de la commande small pieces logistics. Merci d’utiliser!", uid, 1); |
| | | this.pushOrder(orderLogistics);//推单 |
| | | } |
| | | |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用现金成功完成小件物流订单支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the payment of small logistics order with cash, thank you for using!" : |
| | | "Vous avez utilisé de l’argent pour compléter avec succès le paiement de la commande small pieces logistics. Merci d’utiliser!", uid, 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成小件物流订单支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the small parts logistics order payment, thank you for using!" : |
| | | "Vous avez complété avec succès le paiement de la commande small pieces logistics. Merci d’utiliser!", uid, 1); |
| | | |
| | | this.pushOrder(orderLogistics);//推单 |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil payLogisticsOrder_(Integer payType, String accountNumber, Integer orderId, Integer type, Integer language) throws Exception { |
| | | public ResultUtil payLogisticsOrder_(Integer payType, Integer bankCardId, Integer orderId, Integer type, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | Integer uid = orderLogistics.getUserId(); |
| | | OrderLogisticsSpread orderLogisticsSpread = orderLogisticsSpreadService.selectOne(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderId)); |
| | | Double orderMoney = orderLogisticsSpread.getPrice(); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(""); |
| | | if(payType == 1){//线上支付 |
| | | if(payType == 1){//手机支付 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "4" + language + orderId; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(userInfo.getPhone())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(accountNumber); |
| | | checkoutRequest.setAccountNumber(userInfo.getPhone()); |
| | | checkoutRequest.setCustomerFirstName(userInfo.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(userInfo.getLastName()); |
| | | checkoutRequest.setRequestAmount(orderMoney); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderLogisticsSpread"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | |
| | | } |
| | | if(payType == 2){//银行卡支付 |
| | | BankCard bankCard = bankCardService.selectById(bankCardId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "4" + language + orderId; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(bankCard.getCode())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(orderMoney); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderLogisticsSpread"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功完成小件物流订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the price difference payment of small logistics order with the balance, thank you for using!" |
| | | : "Vous avez utilisé le solde pour compléter avec succès le paiement de la différence de prix de la commande de petites pièces logistiques. Merci d’utiliser!", uid, 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成小件物流订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the price difference payment of small parts logistics order, thank you for using!" |
| | | : "Vous avez complété avec succès le paiement de la différence de prix de la commande de petites pièces logistiques, merci d’utiliser!", uid, 1); |
| | | } |
| | | |
| | | if(payType == 4){//现金支付 |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用现金成功完成小件物流订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the price difference payment of small logistics order with cash, thank you for using!" |
| | | : "Vous avez utilisé de l’argent pour compléter avec succès le paiement de la différence de prix de la commande de petites pièces logistiques. Merci d’utiliser!", uid, 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成小件物流订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the price difference payment of small parts logistics order, thank you for using!" |
| | | : "Vous avez complété avec succès le paiement de la différence de prix de la commande de petites pièces logistiques, merci d’utiliser!", uid, 1); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public void payOrderLogisticsCallback(Integer id, String order_id, Integer type, Integer language) throws Exception { |
| | | public void payOrderLogisticsCallback(Integer id, String order_id, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), orderLogistics.getType(), type, 1); |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), orderLogistics.getType(), null, 1); |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, orderLogistics.getType(), query.getOrderId()); |
| | | orderLogistics.setState(1);//先支付后抢单 |
| | | orderLogistics.setPayType(type); |
| | | orderLogistics.setPayType(query.getPayType()); |
| | | orderLogistics.setPayMoney(query.getAmount()); |
| | | this.updateById(orderLogistics); |
| | | |
| | |
| | | }).start(); |
| | | |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成小件物流订单支付,谢谢使用!", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成小件物流订单支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the small parts logistics order payment, thank you for using!" : |
| | | "Vous avez complété avec succès le paiement de la commande small pieces logistics. Merci d’utiliser!", orderLogistics.getUserId(), 1); |
| | | |
| | | this.pushOrder(orderLogistics);//推单 |
| | | }else{ |
| | |
| | | |
| | | |
| | | @Override |
| | | public void payOrderLogisticsSpreadCallback(Integer id, String order_id, Integer type) throws Exception { |
| | | public void payOrderLogisticsSpreadCallback(Integer id, String order_id, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | OrderLogisticsSpread orderLogisticsSpread = orderLogisticsSpreadService.selectOne(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", id)); |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), orderLogistics.getType(), type, 1); |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), orderLogistics.getType(), null, 1); |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流补差价", query.getAmount(), 2, 1, 1, 4, query.getOrderId()); |
| | | orderLogistics.setState(4);//待取货 |
| | | this.updateById(orderLogistics); |
| | | Double orderMoney = query.getAmount(); |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | orderLogisticsSpread.setPayMoney(query.getAmount()); |
| | | orderLogisticsSpread.setPayTime(new Date()); |
| | | orderLogisticsSpread.setPayType(3); |
| | | orderLogisticsSpread.setPayType(query.getPayType()); |
| | | orderLogisticsSpread.setDriverPay(1); |
| | | orderLogisticsSpreadService.updateById(orderLogisticsSpread); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流补差价", orderMoney, 2, 1, 1, 4, id); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | orderLogistics.setState(12);//已支付差价 |
| | | this.updateById(orderLogistics); |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | |
| | | BigDecimal c = null; |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(query.getAmount()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(orderMoney).subtract(d); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | d = new BigDecimal(query.getAmount()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = new BigDecimal(query.getAmount()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | |
| | | Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + d.doubleValue()); |
| | | incomeService.updateById(income); |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成小件物流订单差价支付,谢谢使用!", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功完成小件物流订单差价支付,谢谢使用!" : language == 2 |
| | | ? "You have successfully completed the price difference payment of small parts logistics order, thank you for using!" |
| | | : "Vous avez complété avec succès le paiement de la différence de prix de la commande de petites pièces logistiques, merci d’utiliser!", orderLogistics.getUserId(), 1); |
| | | }else{ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | | } |