package cn.ezhizao.project.business.service.impl;


import cn.ezhizao.project.business.domain.BizDaywork;
import cn.ezhizao.project.business.domain.BizDayworkCarrier;
import cn.ezhizao.project.business.domain.BizDayworkItem;
import cn.ezhizao.project.business.mapper.BizDayworkCarrierMapper;
import cn.ezhizao.project.business.mapper.BizDayworkItemMapper;
import cn.ezhizao.project.business.service.IBizDayworkItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 报工记录Service业务层处理
 *
 * @author ezhizao
 * @date 2023-12-04
 */
@Service
public class BizDayworkItemServiceImpl  extends ServiceImpl<BizDayworkItemMapper, BizDayworkItem> implements IBizDayworkItemService
{
    @Resource
    private BizDayworkItemMapper bizDayworkItemMapper;

    @Resource
    private BizDayworkCarrierMapper bizDayworkCarrierMapper;

    /**
     * 查询报工记录列表
     *
     * @param bizDayworkItem 报工记录
     * @return 报工记录
     */
    @Override
    public List<BizDayworkItem> getList(BizDayworkItem bizDayworkItem)
    {
        return bizDayworkItemMapper.getList(bizDayworkItem);
    }

    @Override
    public List<BizDaywork> getInnerListByDeptId(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getInnerListByDeptId(bizDayworkItem);
    }

    @Override
    public List<BizDaywork> getOutListByDeptId(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getOutListByDeptId(bizDayworkItem);
    }

    /**
     * 物理删除
     * @param bizDayworkItem
     * @return 删除结果
     */
    @Override
    public int physicalDelete(BizDayworkItem bizDayworkItem){ return bizDayworkItemMapper.physicalDelete(bizDayworkItem); }

    @Override
    public List<BizDayworkItem> getListByDayworkId(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getListByDayworkId(bizDayworkItem);
    }

    @Override
    public List<BizDayworkItem> getSortListByDayworkId(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getSortListByDayworkId(bizDayworkItem);
    }

    @Override
    public List<BizDayworkItem> getDayworkItemByCarrier(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getDayworkItemByCarrier(bizDayworkItem);
    }

    @Override
    public List<BizDayworkItem> getDayworkItemByCarrierCode(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getDayworkItemByCarrierCode(bizDayworkItem);
    }

    @Override
    public List<BizDayworkItem> getUndoneItem(BizDayworkItem bizDayworkItem) {
        return bizDayworkItemMapper.getUndoneItem(bizDayworkItem);
    }

    @Override
    public List<BizDayworkItem> getDayWorkItemHistory(String startTime,String endTime,String userName) {
        return bizDayworkItemMapper.getDayWorkItemHistory(startTime,endTime,userName);
    }

    @Override
    public List<BizDayworkItem> getItemScreen(Long dayWorkId) {
        return bizDayworkItemMapper.getItemScreen(dayWorkId);
    }

    /**
     * 获取该用户未完成的快速报工
     * @param userId 用户id
     * @return 返回结果
     */
    @Override
    public List<BizDayworkItem> getUnfinishedDayworkItemByUser(Long userId) {
        return bizDayworkItemMapper.getUnfinishedDayworkItemByUser(userId);
    }

    @Override
    public List<BizDayworkItem> getByDayworkId(Long dayworkId) {
        return bizDayworkItemMapper.getByDayworkId(dayworkId);
    }

    @Override
    public BizDayworkItem selById(Long dayworkItemId) {
        return bizDayworkItemMapper.selById(dayworkItemId);
    }

    @Override
    public List<BizDayworkItem> getDayworkItemByDayworkIds(List<Long> dayworkIds) {
        return bizDayworkItemMapper.getDayworkItemByDayworkIds(dayworkIds);
    }

    @Override
    public List<BizDayworkItem> getByDaywork(BizDaywork daywork) {
        return bizDayworkItemMapper.getByDaywork(daywork);
    }

    @Override
    public List<BizDayworkItem> getTurnoverList(BizDaywork daywork) {
        return bizDayworkItemMapper.getTurnoverList(daywork);
    }



}




