package com.sw.mes.sap.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.sap.dao.WarehouseLocationDao;
import com.sw.mes.sap.entity.WarehouseLocation;
import com.sw.mes.sap.service.WarehouseLocationService;

import groovy.util.logging.Slf4j;

/**
 * 晶科库存位置信息Service业务层处理
 * 
 * @author liru
 * @date 2024-01-02
 */
@Slf4j
@Service
@Transactional
@Jinko(value="晶科库存位置信息Service业务层处理",author = "liru")
public class WarehouseLocationServiceImpl extends BaseServiceImpl<WarehouseLocation> implements WarehouseLocationService
{
    private WarehouseLocationDao dao;

    @Autowired
    public void setDao(WarehouseLocationDao dao) {
        super.setBaseDao(dao);
        this.dao=dao;
    }

    @Override
    public WarehouseLocation findByWerksAndLgort(String werks, String lgort) {
        List<WarehouseLocation> list = dao.findByWerksAndLgort(werks,lgort);
        if(list.size()>0){
            return list.get(0);
        }
        return null;
    }

	@Override
	public List<WarehouseLocation> findAllPWarehouse() {
		return dao.findAllPWarehouse("P%");
	}

}
