package com.jwipc.sys.client.impl;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Pair;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.jwipc.api.dto.ESignFileResposeDTO;
import com.jwipc.sys.client.FileClient;
import com.jwipc.sys.client.MaterialOriginClient;
import com.jwipc.sys.client.convert.FileClientConvert;
import com.jwipc.sys.client.convert.MaterialOriginConvert;
import com.jwipc.sys.client.dto.FileResposeCDTO;
import com.jwipc.sys.client.dto.FileResposePreviewCDTO;
import com.jwipc.sys.client.dto.MaterialOriginDTO;
import com.jwipc.sys.dto.FileResposeDTO;
import com.jwipc.sys.entity.Attachment;
import com.jwipc.sys.entity.MaterialOrigin;
import com.jwipc.sys.logic.FileLogic;
import com.jwipc.sys.service.IAttachmentService;
import com.jwipc.sys.service.IMaterialOriginService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.*;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Service
@RequiredArgsConstructor
public class MaterialOriginClientImpl implements MaterialOriginClient {

    private final IMaterialOriginService materialOriginService;
    private final MaterialOriginConvert materialOriginConvert;

    @Override
    public List<MaterialOriginDTO> getMaterialOriginList() {
        List<MaterialOrigin> list = materialOriginService.list();
        if(CollectionUtils.isNotEmpty(list)){
            return materialOriginConvert.entities2DTOs(list);
        }
        return null;
    }
}
