package com.chushang.inspection.terminal.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.common.mybatis.enums.Operator;
import com.chushang.common.mybatis.page.CommonParam;
import com.chushang.common.mybatis.utils.PageResult;
import com.chushang.common.mybatis.utils.WrapperUtils;
import com.chushang.datascope.annotation.DataScope;
import com.chushang.inspection.project.po.WrkProjectContract;
import com.chushang.inspection.terminal.dto.ConsumablesTotalDTO;
import com.chushang.inspection.terminal.mapper.ConsumablesTotalMapper;
import com.chushang.inspection.terminal.mapper.DispatchRecordMapper;
import com.chushang.inspection.terminal.po.ConsumablesTotal;
import com.chushang.inspection.terminal.query.ConsumablesTotalQuery;
import com.chushang.inspection.terminal.query.FiveUnifiedStoreDetailsQuery;
import com.chushang.inspection.terminal.query.TerminalQuery;
import com.chushang.inspection.terminal.service.ConsumableDetailsService;
import com.chushang.inspection.terminal.service.ConsumablesTotalService;
import com.chushang.inspection.terminal.service.DispatchRecordService;
import com.chushang.inspection.work.po.WrkDispatchRecord;
import com.chushang.security.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
  * @auther: zhao
  * @date: 2024/6/21 11:47
  */
@Slf4j
@Service
public class DispatchRecordServiceImpl extends ServiceImpl<DispatchRecordMapper, WrkDispatchRecord> implements DispatchRecordService {


    @Override
    public PageResult pageList(TerminalQuery query) {
        CommonParam commonParam = TerminalQuery.buildPageRequest();
        LambdaQueryWrapper<WrkDispatchRecord> queryWrapper = WrapperUtils.builder(query, commonParam);
        IPage<WrkDispatchRecord> page = this.page(new Page<>(commonParam.getPage(), commonParam.getLimit()), queryWrapper);
        return new PageResult(page);
    }
}
