package com.wzj.soopin.statistics.service.impl;

import cn.hutool.core.text.CharSequenceUtil;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wzj.soopin.member.domain.po.AccountBill;
import com.wzj.soopin.member.enums.AccountBillChangeTypeEnum;
import com.wzj.soopin.statistics.entity.enums.BillStatusEnum;
import com.wzj.soopin.statistics.mapper.BillStatisticsMapper;
import com.wzj.soopin.statistics.service.BillStatisticsService;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * 结算单统计
 *
 * @author Chopper
 * @since 2020/11/17 4:28 下午
 */
@Service
public class BillStatisticsServiceImpl extends ServiceImpl<BillStatisticsMapper, AccountBill> implements BillStatisticsService {


    @Override
    public long billNum(BillStatusEnum billStatusEnum) {
        LambdaUpdateWrapper<AccountBill> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
//        lambdaUpdateWrapper.eq(Bill::getBillStatus, billStatusEnum.name());
//        lambdaUpdateWrapper.eq(CharSequenceUtil.equals(Objects.requireNonNull(UserContext.getCurrentUser()).getRole().name(), UserEnums.STORE.name()),
//                Bill::getStoreId, UserContext.getCurrentUser().getStoreId());
        return this.count(lambdaUpdateWrapper);
    }


}
