package com.shinsoft.sto.service.impl.ware;

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.shinsoft.sto.mapper.ware.DistributionDetailMapper;
import com.shinsoft.sto.model.system.ResponseCodeMsg;
import com.shinsoft.sto.model.ware.DistributionDetail;
import com.shinsoft.sto.service.ware.DistributionDetailService;
import com.shinsoft.tools.JSONTools;
import com.shinsoft.sto.model.system.ResultJSON;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 配车单明细 服务实现类
 * </p>
 *
 * @author system
 * @since 2024-12-05
 */
@Service
public class DistributionDetailServiceImpl extends ServiceImpl<DistributionDetailMapper, DistributionDetail> implements DistributionDetailService {

    ResultJSON resultJSON;

    @Override
    public ResultJSON query(int page, int rows, Map<String, Object> map) {
        try {
            Page<DistributionDetail> pageParam = new Page<>(page, rows);
            IPage<DistributionDetail> result = baseMapper.selectDistributionDetailPage(pageParam, map);
            return ResultJSON.success(result);
        } catch (Exception ex) {
            ex.printStackTrace();
            return ResultJSON.error(ResponseCodeMsg.CODE_EX, ex.getMessage());
        }
    }
}

