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


import cn.estsh.i3plus.ext.mes.pcn.api.report.IMesYfReportService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.impp.framework.base.controller.MesBaseController;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
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;

/**
 * @Description : Mes业务报表
 * @Reference :
 * @Author : junsheng.li --copy by castle 2024-12-30
 * @CreateDate 2024/6/28 14:17
 * @Modify:
 **/
@Api("Mes业务报表")
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN + "/report")
public class MesBusiReportController  {

    @Autowired
    private IMesYfReportService mesYfReportService;



    @ApiOperation(value = "零件条码状态查询", notes = "零件条码状态查询")
    @GetMapping("/mesProduceSn/query")
    public ResultBean queryMesProduceSn(MesProduceSn mesProduceSn, Pager pager) {
        try {
            return ResultBean.success("查询成功").setListPager(mesYfReportService.queryMesProduceSn(mesProduceSn,pager));
        } catch (ImppBusiException e) {
            return ResultBean.fail(e);
        } catch (Exception e) {
            return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
        }
    }





}
