package com.bohuikeji.delivery.backstage.controller.views;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bohuikeji.delivery.backstage.entity.*;
import com.bohuikeji.frame.module.admin.base.PageTemplateControllerBase;
import com.bohuikeji.frame.module.admin.entity.back.PageEntity;
import com.bohuikeji.frame.module.admin.entity.web.block.ButtonBlock;
import com.bohuikeji.frame.module.admin.entity.web.template.TableTemplate;
import com.bohuikeji.frame.module.admin.enums.ButtonBlockEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 钱包模块
 * @author 10552
 */
@Slf4j
@Controller
@RequestMapping("/views")
public class WalletPage extends PageTemplateControllerBase {

    /**
     * 客户钱包记录
     *
     * @return
     */
    @GetMapping("/table/wallet/record")
    public PageEntity twalletrecord() {
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        QueryWrapper<TCustomerWallet> queryWrapper = getFranQueryWrapper();
        pageTemplate.setQueryWrapper(queryWrapper);
        List<ButtonBlock> buts = new ArrayList<>(0);
        pageTemplate.setBatchButton(buts);
        session.setAttribute("pageTemplate", pageTemplate);
        return PageEntity.page("/wallet/wallet_wait");
    }

    /**
     * 客户钱包记录
     *
     * @return
     */
    @GetMapping("/table/wallet/detail")
    public PageEntity toWalletDetail() {
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        QueryWrapper<TWalletDetail> queryWrapper = getFranQueryWrapper();
        pageTemplate.setQueryWrapper(queryWrapper);
        List<ButtonBlock> buts = new ArrayList<>(0);
        pageTemplate.setBatchButton(buts);
        session.setAttribute("pageTemplate", pageTemplate);
        return PageEntity.page("/table/index");
    }

    /**
     * 客户钱包充值记录
     *
     * @return
     */
    @GetMapping("/table/customer/pay")
    public PageEntity toTCustomerPay() {
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        QueryWrapper<TCustomerPay> queryWrapper = getFranQueryWrapper();
        pageTemplate.setQueryWrapper(queryWrapper);
        List<ButtonBlock> buts = new ArrayList<>(0);
        pageTemplate.setBatchButton(buts);
        session.setAttribute("pageTemplate", pageTemplate);
        return PageEntity.page("/table/index");
    }

    /**
     * 客户钱包充值记录
     *
     * @return
     */
    @GetMapping("/table/wallet/wxtransfers")
    public PageEntity toTWxtransfers() {
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        QueryWrapper<TWxtransfers> queryWrapper = getFranQueryWrapper();
        pageTemplate.setQueryWrapper(queryWrapper);
        List<ButtonBlock> buts = new ArrayList<>(0);
        pageTemplate.setBatchButton(buts);
        session.setAttribute("pageTemplate", pageTemplate);
        return PageEntity.page("/table/index");
    }

    /**
     * 客户钱包充值赠金记录
     *
     * @return
     */
    @GetMapping("/table/wallet/gift/price")
    public PageEntity giftRecord() {
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        QueryWrapper<TGiveDetail> queryWrapper = getFranQueryWrapper();
        pageTemplate.setQueryWrapper(queryWrapper);
        List<ButtonBlock> buts = new ArrayList<>(0);
        pageTemplate.setBatchButton(buts);
        session.setAttribute("pageTemplate", pageTemplate);
        return PageEntity.page("/table/index");
    }

    /**
     * 微信账户余额提现
     *
     * @return
     */
    @GetMapping("/table/extract/record")
    public PageEntity extractRecord() {
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        QueryWrapper<TExtractRecord> queryWrapper = getFranQueryWrapper();
        pageTemplate.setQueryWrapper(queryWrapper);
        List<ButtonBlock> buts = new ArrayList<>(0);
        pageTemplate.setBatchButton(buts);
        session.setAttribute("pageTemplate", pageTemplate);
        return PageEntity.page("/tExtractRecord/extract_record");
    }

}
