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

import cn.estsh.i3plus.ext.mes.pcn.api.base.bu3.ISxReworkRangeService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesReworkRange;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.bu3.SxReworkRangeModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesReworkRangeRepository;
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;

import java.util.List;
import java.util.Map;

/**
 * @PROJECT_NAME: i3plus-qms-panasonic
 * @DESCRIPTION:
 * @USER: xinwang.yi
 * @DATE: 2023-06-14 10:31
 */
@Service
public class SxReworkRangeService implements ISxReworkRangeService {

    @Autowired
    private MesReworkRangeRepository reworkRangeRepository;

    //@Override
    //public ListPager<MesReworkRange> queryMesReworkRangeByPager(MesReworkRange reworkRange, Pager pager) {
    //    DdlPackBean packBean = MesPcnExtHqlPack.getReworkRange(reworkRange);
    //    List<MesReworkRange> reworkRangeDbList = reworkRangeRepository.findByHqlWhere(packBean);
    //
    //    //reworkRangeDbList.subList()
    //    return new ListPager<>(reworkRangeDbList, pager);
    //}

    @Override
    public List<MesReworkRange> queryMesReworkRangeList(String organizeCode, String workOrderNo, String workTime, String shiftCode) {
        return reworkRangeRepository.findByProperty(
                new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.WORK_TIME, MesPcnExtConstWords.SHIFT_CODE},
                new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, workTime, shiftCode});
    }

    @Override
    public List<SxReworkRangeModel> queryNotBindStatusMesReworkRangeList(Map<String, Object> params) {

        return null;
    }


}
