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

import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesPartProdGroupService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesPartProdGroup;
import cn.estsh.i3plus.pojo.mes.repository.MesPartProdGroupRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @PROJECT_NAME: i3plus-mes-yfai
 * @DESCRIPTION: 零件生产组
 * @USER: xinwang.yi
 * @DATE: 2024-09-24 11:06
 */
@Service
public class MesPartProdGroupService implements IMesPartProdGroupService {

    @Autowired
    private MesPartProdGroupRepository partProdGroupRepository;
    @Override
    public List<MesPartProdGroup> queryMesPartProdGroup(MesPartProdGroup partProdGroup) {
        DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(partProdGroup.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(partProdGroup.getWorkCenterCode(), MesPcnExtConstWords.WORK_CENTER_CODE,ddlPackBean);
        return partProdGroupRepository.findByHqlWhere(ddlPackBean);
    }
}
