package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;

import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPartPullService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPullingOrderInfoService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.MesPartPull;
import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord;
import cn.estsh.i3plus.pojo.mes.bean.MesPullingOrderInfo;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 拉动组
 */
@Api("拉动组")
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN+ "/mesPartPull")
public class MesPartPullController {

    @Autowired
    private IMesPartPullService mesPartPullService;

    @GetMapping(value = "/query")
    @ApiOperation(value = "查询拉动组")
    public ResultBean queryMesPartPull(MesPartPull mesPartPull) {
        try {
            mesPartPull.setOrganizeCode(mesPartPull.getOrganizeCode());
            List<MesPartPull> partInspectionList= mesPartPullService.queryMesPartPull(mesPartPull);
            return ResultBean.success("查询成功").setResultList(partInspectionList);

        } catch (ImppBusiException e) {
            return ResultBean.fail(e).build();
        } catch (Exception e) {
            return ResultBean.fail(e);
        }
    }
}
