package com.yeechart.dotMatrix.module.DotMatrix.service.impl;

import com.yeechart.dotMatrix.module.DotMatrix.service.DotMatrixService;
import com.yeechart.dotMatrix.signage.SignageDrawUtil;
import com.yeechart.dotMatrix.signage.SignageFileUtil;
import com.yeechart.dotMatrix.signage.SignageQualityUtil;
import com.yeechart.dotMatrix.signage.bean.Ter020201Vo;
import com.yeechart.dotMatrix.signage.bean.mizilzo.BitmapDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.CompletableFuture;

@Service
public class DotMatrixServiceImpl implements DotMatrixService {


    @Autowired
    private SignageDrawUtil signageDrawUtil;

        @Autowired
    private SignageQualityUtil signageQualityUtil;

        @Autowired
        private SignageFileUtil signageFileUtil;

    @Override
    public List<BitmapDataVo> getSignageDotMatrix(Ter020201Vo ter020201Vo) {
        return signageDrawUtil.getSignageDotMatrix(ter020201Vo);

    }

    @Override
    public List<BitmapDataVo> getBatchBitmapQualityInspection() {
        CompletableFuture<List<BitmapDataVo>> completableFuture = signageQualityUtil.getBatchBitmapQualityInspection();
        return completableFuture.join();
    }

    @Override
    public void delDotMatrix(String deID) {
         signageFileUtil.deleteSignageDotMatrix(deID);
    }
}
