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

import cn.estsh.i3plus.ext.mes.pcn.api.base.bu.IMesProductPrintTypeService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesProductPrintType;
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesProductPrintTypeRepository;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @PROJECT_NAME: i3plus-mes-panasonic-bu
 * @DESCRIPTION:
 * @USER: xinwang.yi
 * @DATE: 2023-01-03 13:59
 */
@Service
public class MesProductPrintTypeService implements IMesProductPrintTypeService {

    @Autowired
    private MesProductPrintTypeRepository productPrintTypeRepository;
    @Override
    public MesProductPrintType queryProdPrintTypeByPartNoAndPrintType(String partNo, Integer printType, String organizeCode) {
        return productPrintTypeRepository.getByProperty(
                new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.IS_DELETED,
                        MesPcnExtConstWords.PART_NO, MesPcnExtConstWords.PRINT_TYPE},
                new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), partNo, printType});
    }
}
