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


import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.fls.dao.TempTurnstoreTrayItemDao;
import com.sw.mes.fls.entity.TempTurnstoreTrayItem;
import com.sw.mes.fls.service.TempTurnstoreTrayItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


/**
* @Author
* @Description：
* @Date: Create in
* @Modified By:
*/
@Service
@Transactional
public class TempTurnstoreTrayItemServiceImpl extends BaseServiceImpl<TempTurnstoreTrayItem> implements TempTurnstoreTrayItemService {
    TempTurnstoreTrayItemDao dao;
	@Autowired
    public void setDao(TempTurnstoreTrayItemDao dao) {
        super.setBaseDao(dao);
        this.dao=dao;
    }

    @Override
    public TempTurnstoreTrayItem findMaxCurrentPositionByTrayId(Integer id) {
        return dao.findMaxCurrentPositionByTrayId(id);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW,isolation = Isolation.READ_COMMITTED)
    public List<TempTurnstoreTrayItem> findByTrayId(Integer id) {
        return dao.findByTrayId(id);
    }

    /**
     * 查询还未组托的单晶
     * @param sectionNo
     * @return
     */
    @Override
    public Map<String, Object> findBySectionNoWithoutGrouped(String sectionNo) {
        return dao.findBySectionNoWithoutGrouped(sectionNo);
    }

}
