package com.ruoyi.api.service.impl;

import com.ruoyi.api.domain.CheckTaskInfo;
import com.ruoyi.api.domain.InStoreDto;
import com.ruoyi.api.domain.OutStoreDto;
import com.ruoyi.api.domain.StockDto;
import com.ruoyi.api.mapper.ApiMapper;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wanghao
 * @date 2024/1/17  14:26
 */
@Service
public class ApiService {
    @Autowired
    private ApiMapper mapper;

    @Transactional
    public int submintInsertRecordIn(InStoreDto inStore) {
        return mapper.submintInsertRecordIn(inStore);
    }

    @Transactional
    public int submintInsertLedger(InStoreDto inStore) {
        return mapper.submintInsertLedger(inStore);
    }

    public int submitInsertRecordOut(OutStoreDto outStoreDto, String epc) {
        return mapper.submitInsertRecordOut(outStoreDto, epc);
    }

    public int updataLedger(OutStoreDto outStoreDto) {
        return mapper.updataLedger(outStoreDto);
    }

    public List<StockDto> storeCheckSelect() {
        return mapper.storeCheckSelect();
    }

    public void insertCheckInfo(List<StockDto> list, Long checkId) {
        mapper.insertCheckInfo(list, checkId);
    }

    public List<StockDto> xjSelect(String user) {
        return mapper.xjSelect(user);
    }

    public LedgerRfid bfSelect(String epc) {
        return mapper.bfSelect(epc);
    }

    public void updataLedgerForBf(String epc, String state) {
        mapper.updataLedgerForBf(epc, state);
    }

    public LedgerRfid fpInSelect(String epc) {
        return mapper.fpInSelect(epc);
    }

    public int fpInSubmit(String epc, String localtionCode, String user, String bf, String subCode) {
        return mapper.fpInSubmit(epc, localtionCode, user, bf, subCode);
    }

    public void updataLedgerIn(String epc, String locationCode) {
        mapper.updataLedgerIn(epc, locationCode);
    }

    public void insertInspectionInfo(List<StockDto> list, Long inspectionId) {
        mapper.insertInspectionInfo(list, inspectionId);
    }

    public List<StockDto> fpOutSelect() {
        return mapper.fpOutSelect();
    }

    @Transactional
    public void insertWasreOutRecord(List<StockDto> list, String user) {
        mapper.insertWasreOutRecord(list, user);
    }

    @Transactional
    public void updataLedgerForWasreOut(List<StockDto> list, String user) {
        mapper.updataLedgerForWasreOut(list);
    }

    public String selectLedgerbyEpcForInStore(String epc) {
        return mapper.selectLedgerbyEpcForInStore(epc);
    }

    public String selectLedgerbyEpcForOutStore(String epc) {
        return mapper.selectLedgerbyEpcForOutStore(epc);
    }

    public int updataLedgerFoyOut(OutStoreDto outStoreDto, String epc) {
        return mapper.updataLedgerFoyOut(outStoreDto, epc);
    }

    public List<CheckTaskInfo> selectLocationByAreaUser(String user) {
        return mapper.selectLocationByAreaUser(user);
    }

    public void insertCheckTask(int id, List<CheckTaskInfo> list) {
        mapper.insertCheckTask(id, list);
    }

    public List<CheckTaskInfo> inspectionSelectTask(String user) {
        return mapper.inspectionSelectTask(user);
    }

    public List<StockDto> inspectionSelectLocation(String code) {
        return mapper.inspectionSelectLocation(code);
    }

    public void updataInspectionTaskByObjid(long tableId) {
        mapper.updataInspectionTaskByObjid(tableId);
    }

    public void insertInspetionPictrue(long inspectionId, long tableId, String user, String pathName) {
        mapper.insertInspetionPictrue(inspectionId, tableId,user, pathName);
    }

    public void insertBfImg(Long objid, String epc, String user, String pathName) {
        mapper.insertBfImg(objid,epc,user, pathName);
    }
}
