package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.jx;

import cn.estsh.i3plus.ext.mes.pcn.api.busi.jx.IJxSubassemblyRemadeRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesSubassemblyRemadeRecord;
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesSubassemblyRemadeRecordRepository;
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-jx
 * @DESCRIPTION: 组件返工包装信息
 * @USER: xinwang.yi
 * @DATE: 2023-10-31 13:59
 */
@Service
public class JxSubassemblyRemadeRecordService implements IJxSubassemblyRemadeRecordService {

    @Autowired
    private MesSubassemblyRemadeRecordRepository subassemblyRemadeRecordRepository;

    @Override
    public MesSubassemblyRemadeRecord getSubassemblyRemadeRecordByWoAndPo(String workOrderNo, String packageNo, String organizeCode) {
        return subassemblyRemadeRecordRepository.getByProperty(
                new String[]{MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.PACKAGENO, MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID},
                new Object[]{workOrderNo,
                        packageNo, organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()});
    }

}
