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

import cn.estsh.i3plus.ext.mes.api.busi.bu3.ISxUnbindProduceSnService;
import cn.estsh.i3plus.ext.mes.api.busi.bu3.ISxWorkOrderExtService;
import cn.estsh.i3plus.ext.mes.apiservice.util.SxDateRangeUtils;
import cn.estsh.i3plus.ext.mes.pojo.bean.MesUnbindProduceSn;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import cn.estsh.i3plus.pojo.mes.repository.MesWorkOrderRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

@Slf4j
@Service
public class SxWorkOrderExtService implements ISxWorkOrderExtService {

    @Autowired
    private ISxUnbindProduceSnService unbindProduceSnService;

    @Autowired
    private MesWorkOrderRepository workOrderRepository;

    @Override
    public List<MesWorkOrder> queryWorkOrderListByModifyDatetime(MesWorkOrder workOrder) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(workOrder.getOrganizeCode());
        DdlPreparedPack.timeBuilder(workOrder.getModifyDateTimeStart(), workOrder.getModifyDateTimeEnd(), MesExtConstWords.MODIFY_DATE_TIME, packBean, true);
        return workOrderRepository.findByHqlWhere(packBean);
    }


}
