package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;

import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesPartPackageTypeService;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesPartPackageType;
import cn.estsh.i3plus.pojo.mes.repository.IMesPartPackageTypeRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author jason
 */
@Service
@Slf4j
public class MesPartPackageTypeServiceImpl implements IMesPartPackageTypeService {
    @Autowired
    private IMesPartPackageTypeRepository partPackageTypeRDao;

    @Override
    public MesPartPackageType getMesPartPackageType(String organizeCode, String packageTypeCode) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
        DdlPreparedPack.getStringEqualPack(packageTypeCode, "packageTypeCode", packBean);
        return partPackageTypeRDao.getByProperty(packBean);
    }
}
