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

import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesPackingDefineService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesPackingDefine;
import cn.estsh.i3plus.pojo.mes.repository.MesPackingDefineRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @PROJECT_NAME: i3plus-mes-yfai
 * @DESCRIPTION:
 * @USER: xinwang.yi
 * @DATE: 2024-09-12 16:53
 */
@Service
public class MesPackingDefineService implements IMesPackingDefineService {

    @Autowired
    private MesPackingDefineRepository packingDefineRepository;

    @Override
    public MesPackingDefine getMesPackingDefine(String packCode, String organizeCode) {
        return packingDefineRepository.getByProperty(
                new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.PACK_CODE},
                new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), packCode});
    }
}
