package com.miaxis.wx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miaxis.system.service.ISysConfigService;
import com.miaxis.wx.domain.WxOrder;
import com.miaxis.wx.mapper.WxOrderMapper;
import com.miaxis.wx.service.IWxOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 电影订单Service业务层处理
 *
 * @author miaxis
 * @date 2021-05-07
 */
@Service
@Slf4j
public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> implements IWxOrderService {
    @Resource
    private WxOrderMapper wxOrderMapper;


    @Autowired
    private ISysConfigService configService;



    @Override
    public void createVipOrder(WxOrder wxOrder) {
        String price = configService.selectConfigByKey("vip_price");
        Double dprice = Double.valueOf(price);
        Double v =dprice* 100;
        wxOrder.setTotal(v.intValue());


    }
    @Override
    public WxOrder getByOutTradeNo(String outTradeNo) {
        return wxOrderMapper.getByOutTradeNo(outTradeNo);
    }
}
