zoukankan      html  css  js  c++  java
  • Mybaits中session的应用一

            获取一级缓存session
            SqlSession session = this.yangchebaoDbManagerImpl.getSqlSessionFactory().openSession(false)
      MaintainOrderMapper maintainOrderMapper = session.getMapper(MaintainOrderMapper.class);
            MaintainOrderPayMapper maintainOrderPayMapper = session.getMapper(MaintainOrderPayMapper.class);
            try {
                order.setIspay(EnumUUStatusDesc.IS_PAY_ONLINE.getIntegerValue());// 付款状态
                order.setIspayName(EnumUUStatusDesc.IS_PAY_ONLINE.getText());// 支付方式描述
                order.setPayChannelId(payChannelId);
                
                // 订单支付记录
                MaintainOrderPay orderPay = new MaintainOrderPay();
                orderPay.setMaintainOrderId(orderId);// 上门保养订单ID
                orderPay.setPayChannelId(payChannelId);// 支付渠道ID
                orderPay.setTradeNo(tradeNo);// 第三方支付交易号
                orderPay.setRedeemCode(null);// 抵用券/优惠券信息
                orderPay.setPayment(order.getPayment());// 通过该支付渠道支付的金额
                orderPay.setDiscount(0.0);// 抵扣金额
                orderPay.setTradeDate(now);// 交易完成时间
                orderPay.setStatus(SwitchStatus.YES.getCode());// 交易状态  0:失败  1:成功
                orderPay.setCreateDate(now);// 记录创建时间
                
                // 更新订单的相关信息
                maintainOrderMapper.updateByPrimaryKey(order);
                
                // 添加订单支付记录
                maintainOrderPayMapper.insert(orderPay);
                
                session.commit();
                this.loadOnlinePaySuccessOrder(orderId, now);
            } catch (Exception e) {
                session.rollback();
                logger.error(e.getMessage(), e);
                throw new InternalErrorException(e);
            } finally {
                session.close();
            }
  • 相关阅读:
    i++ 与++i
    jquery下的domcument
    jquery
    MVC MVP MVVM
    两个for还是一个for?
    华为云服务器FTP连接
    vue-i18n 使用方法
    在本地运行vue build 文件
    vue项目中使用模拟数据 MOCK
    超简单 超详细 vue项目中使用svg图标 阿里巴巴图标库
  • 原文地址:https://www.cnblogs.com/tian830937/p/5520196.html
Copyright © 2011-2022 走看看