Example #1
0
        public override ExecutionResult Check(object dataParam)
        {
            var exeResult = (ExecutionResult)dataParam;

            try
            {
                string sn          = exeResult.Sn;
                string stationName = exeResult.StationName;
                bool   mode        = exeResult.IsAlive;
                if (sn == "")
                {
                    exeResult.Status  = false;
                    exeResult.Message = "管号为空!";
                    return(exeResult);
                }
                if (stationName == "")
                {
                    exeResult.Status  = false;
                    exeResult.Message = "站点名为空!";
                    return(exeResult);
                }

                exeResult = _routeController.CheckSn(stationName, sn, mode);
                if (!exeResult.Status)
                {
                    return(exeResult);
                }
                #region 查询管型
                string productType = "";
                exeResult = _routeController.GetProductType(sn);
                if (exeResult.Status)
                {
                    productType = (string)exeResult.Anything;
                }
                if (!exeResult.Status)
                {
                    return(exeResult);
                }

                #endregion
                if (exeResult.Status)
                {
                    exeResult = _dao.GetIvcCountInfo();
                    var dsCount = (DataSet)exeResult.Anything;
                    int count   = 0;
                    if (dsCount != null && dsCount.Tables[0].Rows.Count > 0)
                    {
                        count = int.Parse(dsCount.Tables[0].Rows[0]["NUMBER"].ToString());
                    }

                    if (count < 3)
                    {
                        exeResult = _dao.GetIVDataInfo(sn);
                        if (exeResult.Status)
                        {
                            var ds = (DataSet)exeResult.Anything;
                            if (ds != null && ds.Tables[0].Rows.Count > 0)
                            {
                                DateTime createTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["CREATE_TIME"] ?? "");
                                createTime = createTime + System.TimeSpan.FromMinutes(5);
                                if (DateTime.Now > createTime)
                                {
                                    exeResult = _dao.InsertIVDataInfo(sn, productType, stationName);
                                    if (exeResult.Status)
                                    {
                                        exeResult.Message = "管号:" + sn + "已成功插入IVCTEST_DATA数据库中";
                                    }
                                    else
                                    {
                                        exeResult.Message = "未能将管号:" + sn + "插入IVCTEST_DATA数据库中";
                                    }
                                }
                                else
                                {
                                    exeResult = _dao.UpdateIVDataInfo(productType, sn, stationName);
                                    if (exeResult.Status)
                                    {
                                        exeResult.Message = "管号:" + sn + "已成功更新IVCTEST_DATA数据库中";
                                    }
                                    else
                                    {
                                        exeResult.Message = "未能将管号:" + sn + "更新IVCTEST_DATA数据库中失败";
                                    }
                                }
                            }
                            else
                            {
                                exeResult = _dao.InsertIVDataInfo(sn, productType, stationName);
                                if (exeResult.Status)
                                {
                                    exeResult.Message = "管号:" + sn + "已成功插入IVCTEST_DATA数据库中";
                                }
                                else
                                {
                                    exeResult.Message = "未能将管号:" + sn + "插入IVCTEST_DATA数据库中";
                                }
                            }
                        }
                        else
                        {
                            exeResult.Status  = false;
                            exeResult.Message = "查询雷电冲击数据库失败";
                        }
                    }
                    else
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "已经扫描" + count + "条数据,请等待雷电冲击测试完成!";
                    }
                }
            }
            catch (Exception e)
            {
                exeResult.Status  = false;
                exeResult.Message = e.Message;
            }


            return(exeResult);
        }
Example #2
0
        public override ExecutionResult Check(object dataParam)
        {
            var    exeResult   = (ExecutionResult)dataParam;
            string sn          = exeResult.Sn;
            string stationName = exeResult.StationName;
            bool   mode        = exeResult.IsAlive;

            if (sn == "")
            {
                exeResult.Status  = false;
                exeResult.Message = "管号为空!";
                return(exeResult);
            }
            if (stationName == "")
            {
                exeResult.Status  = false;
                exeResult.Message = "站点名为空!";
                return(exeResult);
            }
            exeResult = _routeController.CheckSn(stationName, sn, mode);
            if (exeResult.Status)
            {
                #region 查询管型编号
                string productSerial = "";
                if (exeResult.Status)
                {
                    exeResult = _routeController.GetProductSerial(sn);


                    if (exeResult.Status)
                    {
                        productSerial     = (string)exeResult.Anything;
                        exeResult.Message = "管号:" + sn + "流程验证成功!";
                    }
                    if (!exeResult.Status)
                    {
                        return(exeResult);
                    }
                }
                #endregion

                #region 查询管型
                string productType = "";
                if (exeResult.Status)
                {
                    exeResult = _routeController.GetProductType(sn);
                    if (exeResult.Status)
                    {
                        productType       = (string)exeResult.Anything;
                        exeResult.Message = "管号:" + sn + "流程验证成功!";
                    }
                    if (!exeResult.Status)
                    {
                        return(exeResult);
                    }
                }
                #endregion

                if (KepController.KepHelper != null && KepController.KepHelper.State)
                {
                    KepController.KepHelper.Write(ProductSerial, productSerial);
                    KepController.KepHelper.Write(ProductType, productType);
                    KepController.KepHelper.Write(Sn, sn);
                    var productSerialok = (KepController.KepHelper.Read(ProductSerial) ?? "").ToString();
                    if (productSerial != productSerialok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管型序号失败!";
                        return(exeResult);
                    }

                    var productTypeok = (KepController.KepHelper.Read(ProductType) ?? "").ToString();
                    if (productType != productTypeok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管型失败!";
                        return(exeResult);
                    }

                    var snok = (KepController.KepHelper.Read(Sn) ?? "").ToString();
                    if (sn != snok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管号失败!";
                        return(exeResult);
                    }
                    KepController.KepHelper.Write(ScanFinish, 1);
                }
                else
                {
                    exeResult.Status  = false;
                    exeResult.Message = "未连接KEP服务器!";
                    return(exeResult);
                }
            }
            else
            {
                string message = exeResult.Message;
                exeResult = _dao.GetWipErrorFlagBySn(sn);
                DataSet ds = (DataSet)exeResult.Anything;
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    string errorFlag = (ds.Tables[0].Rows[0]["ERROR_FLAG"] ?? "").ToString();
                    if (errorFlag == "1")
                    {
                        KepController.KepHelper.Write(GoBadLine, 1);
                        exeResult.Message = message + "回废品线!";
                    }
                    else
                    {
                        KepController.KepHelper.Write(GoBadLine, 1);
                        exeResult.Message = message + "产品流程不对回废品线!";
                    }
                }
            }
            return(exeResult);
        }
Example #3
0
        public override ExecutionResult Check(object dataParam)
        {
            var    exeResult    = (ExecutionResult)dataParam;
            string sn           = exeResult.Sn;
            string stationName  = exeResult.StationName;
            bool   modeAll      = exeResult.IsAlive;
            string cproductType = exeResult.ProductType;

            if (sn == "")
            {
                exeResult.Status  = false;
                exeResult.Message = "管号为空!";
                return(exeResult);
            }
            if (stationName == "")
            {
                exeResult.Status  = false;
                exeResult.Message = "站点名为空!";
                return(exeResult);
            }
            //模式选择条件: false:完全测试 ;true:部分测试
            exeResult = _routeController.CheckSn(stationName, sn, modeAll);
            if (exeResult.Status)
            {
                #region 查询管型
                string productType = "";
                if (exeResult.Status)
                {
                    exeResult = _routeController.GetProductType(sn);
                    if (exeResult.Status)
                    {
                        productType = (string)exeResult.Anything;
                        if (productType != cproductType)
                        {
                            exeResult.Message = "产线管型:" + cproductType + "与上线维护管型:" + productType + "不一致";
                            exeResult.Status  = false;
                            return(exeResult);
                        }
                    }
                    if (!exeResult.Status)
                    {
                        return(exeResult);
                    }
                }
                #endregion

                if (KepController.KepHelper != null && KepController.KepHelper.State)
                {
                    var autorun = (KepController.KepHelper.Read(AutoRun) ?? "").ToString();
                    if (autorun == "False")
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "线体不在自动运行模式,无法扫描录入!";
                        return(exeResult);
                    }
                    var unable = (KepController.KepHelper.Read(UnableScan) ?? "").ToString();
                    if (unable == "True")
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "接触电阻站有件,请处理完再次进行扫描!";
                        return(exeResult);
                    }
                    KepController.KepHelper.Write(ProductType, productType);
                    KepController.KepHelper.Write(Sn, sn);
                    var productTypeok = (KepController.KepHelper.Read(ProductType) ?? "").ToString();
                    if (productType != productTypeok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管型失败!";
                        return(exeResult);
                    }

                    var snok = (KepController.KepHelper.Read(Sn) ?? "").ToString();
                    if (sn != snok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管号失败!";
                        return(exeResult);
                    }

                    KepController.KepHelper.Write(ScanFinish, 1);
                }
                else
                {
                    exeResult.Status  = false;
                    exeResult.Message = "未连接KEP服务器!";
                    return(exeResult);
                }
            }
            return(exeResult);
        }
Example #4
0
        public override ExecutionResult Check(object dataParam)
        {
            var    exeResult   = (ExecutionResult)dataParam;
            string sn          = exeResult.Sn;
            string stationName = exeResult.StationName;
            bool   mode        = exeResult.IsAlive;

            if (sn == "")
            {
                exeResult.Status  = false;
                exeResult.Message = "管号为空!";
                return(exeResult);
            }
            if (stationName == "")
            {
                exeResult.Status  = false;
                exeResult.Message = "站点名为空!";
                return(exeResult);
            }
            exeResult = _routeController.CheckSn(stationName, sn, mode);
            if (exeResult.Status)
            {
                #region 查询管型
                string productType = "";
                if (exeResult.Status)
                {
                    exeResult = _routeController.GetProductType(sn);
                    if (exeResult.Status)
                    {
                        productType       = (string)exeResult.Anything;
                        exeResult.Message = "管号:" + sn + "流程验证成功!";
                    }
                    if (!exeResult.Status)
                    {
                        return(exeResult);
                    }
                }
                #endregion
                #region 发送第一次真空度数据
                if (KepController.KepHelper != null && KepController.KepHelper.State)
                {
                    KepController.KepHelper.Write(ProductType, productType);
                    KepController.KepHelper.Write(Sn, sn);
                    exeResult = _dao.GetVacuumValueBySn(sn);
                    if (exeResult.Status)
                    {
                        var ds = (DataSet)exeResult.Anything;
                        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                        {
                            string vacuumValue = double.Parse(ds.Tables[0].Rows[0]["TEST_VALUE"].ToString()).ToString("#.##E+0");
                            if (vacuumValue == "1.01E-7")
                            {
                                vacuumValue = "<1E-6";
                            }
                            if (vacuumValue == "1.01E-2")
                            {
                                vacuumValue = ">1E-2";
                            }

                            if (!string.IsNullOrWhiteSpace(vacuumValue))
                            {
                                KepController.KepHelper.Write(FirstVacuumValue, vacuumValue);
                            }
                        }
                        else
                        {
                            exeResult.Status  = false;
                            exeResult.Message = "没有第一次真空度测试值记录!";
                            KepController.KepHelper.Write(GoBadLine, 1); return(exeResult);
                        }
                    }

                    var productTypeok = (KepController.KepHelper.Read(ProductType) ?? "").ToString();
                    if (productType != productTypeok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管型失败!";
                        return(exeResult);
                    }

                    var snok = (KepController.KepHelper.Read(Sn) ?? "").ToString();
                    if (sn != snok)
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "发送管号失败!";
                        return(exeResult);
                    }

                    KepController.KepHelper.Write(ScanFinish, 1);
                }

                else
                {
                    exeResult.Status  = false;
                    exeResult.Message = "未连接KEP服务器!";
                    return(exeResult);
                }
                #endregion
            }
            else
            {
                string message = exeResult.Message;
                exeResult = _dao.GetWipErrorFlagBySn(sn);
                DataSet ds = (DataSet)exeResult.Anything;
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    string errorFlag = (ds.Tables[0].Rows[0]["ERROR_FLAG"] ?? "").ToString();
                    if (errorFlag == "1")
                    {
                        KepController.KepHelper.Write(GoBadLine, 1);
                        exeResult.Message = message + "回废品线!";
                    }
                    else
                    {
                        KepController.KepHelper.Write(GoGoodLine, 1);
                        exeResult.Message = message + "产品回正常线!";
                    }
                }
            }
            return(exeResult);
        }
Example #5
0
        public override ExecutionResult Check(object dataParam)
        {
            _exeResult = (ExecutionResult)dataParam;
            try
            {
                string sn           = _exeResult.Sn;
                string stationName  = _exeResult.StationName;
                bool   mode         = _exeResult.IsAlive;
                string cproductType = _exeResult.ProductType;
                if (sn == "")
                {
                    _exeResult.Status  = false;
                    _exeResult.Message = "管号为空!";
                    return(_exeResult);
                }
                if (stationName == "")
                {
                    _exeResult.Status  = false;
                    _exeResult.Message = "站点名为空!";
                    return(_exeResult);
                }

                _exeResult = _routeController.CheckSn(stationName, sn, mode);
                if (_exeResult.Status)
                {
                    #region 查询x射线工位不良描述
                    if (ErrorCodeHelper.ErrorCodeDic.Count <= 0 || ErrorCodeHelper.DescAddrDic.Count <= 0)
                    {
                        _exeResult = ErrorCodeHelper.GetErrorCodeInfo("X射线工位");
                    }
                    if (!_exeResult.Status)
                    {
                        return(_exeResult);
                    }
                    #endregion

                    #region 查询是否墩粗、喷漆
                    string isUpsetting     = "False";
                    string isSprayPainting = "False";
                    string isXray          = "True";
                    string isFirstVacuum   = "True";
                    if (_exeResult.Status)
                    {
                        _exeResult = RouteDAO.GetRouteInfo(sn);
                        DataSet ds = _exeResult.Anything as DataSet;
                        if (ds != null && ds.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow dr in ds.Tables[0].Rows)
                            {
                                string name = dr["STATION_NAME"].ToString();
                                if (name == "喷漆")
                                {
                                    isSprayPainting = "True";
                                }
                                if (name == "墩粗")
                                {
                                    isUpsetting = "True";
                                }
                                if (name == "第一次真空度测试")
                                {
                                    isFirstVacuum = "False";
                                }
                                if (name == "X射线工位")
                                {
                                    isXray = "False";
                                }
                            }
                        }
                        if (!_exeResult.Status)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "未找到管号:" + sn + "对应的流程!";
                            return(_exeResult);
                        }
                    }
                    #endregion

                    #region 查询管型编号
                    string productSerial = "";

                    if (_exeResult.Status)
                    {
                        _exeResult = _routeController.GetProductSerial(sn);

                        if (_exeResult.Status)
                        {
                            productSerial = (string)_exeResult.Anything;
                        }
                        if (!_exeResult.Status)
                        {
                            return(_exeResult);
                        }
                    }

                    #endregion

                    #region 查询管型
                    string productType = "";
                    if (_exeResult.Status)
                    {
                        _exeResult = _routeController.GetProductType(sn);
                        if (_exeResult.Status)
                        {
                            productType = (string)_exeResult.Anything;
                            if (productType != cproductType)
                            {
                                _exeResult.Message = "产线管型:" + cproductType + "与上线维护管型:" + productType + "不一致";
                                _exeResult.Status  = false;
                                return(_exeResult);
                            }
                        }
                        if (!_exeResult.Status)
                        {
                            return(_exeResult);
                        }
                    }
                    #endregion

                    #region 查询托盘大小

                    string pallet = "";
                    if (_exeResult.Status)
                    {
                        _exeResult = _routeController.GetPalletByProductType(productType);
                        if (_exeResult.Status)
                        {
                            pallet = (string)_exeResult.Anything;
                            if (pallet == "1")
                            {
                                pallet = "True";
                            }
                            else
                            {
                                pallet = "False";
                            }
                        }
                        if (!_exeResult.Status)
                        {
                            return(_exeResult);
                        }
                    }
                    #endregion

                    if (KepController.KepHelper != null && KepController.KepHelper.State)
                    {   //给pLC发送管型、管号、管型编号、是否墩粗、是否喷漆
                        var autorun = (KepController.KepHelper.Read(AutoRun) ?? "").ToString();
                        if (autorun == "False")
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "线体不在自动运行模式,无法扫描录入!";
                            return(_exeResult);
                        }

                        var badMode = (KepController.KepHelper.Read(BadMode) ?? "").ToString();
                        if (badMode == "True")
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "线体在废品上线模式,无法扫描录入!";
                            return(_exeResult);
                        }
                        var productSerialIsOk = (KepController.KepHelper.Read(ProductSerial) ?? "").ToString();

                        if (productSerialIsOk == productSerial)
                        {
                            var palletisok = (KepController.KepHelper.Read(Pallet) ?? "").ToString();
                            if (palletisok == "True")
                            {
                                int scanCount = int.Parse(KepController.KepHelper.Read(ScanCount).ToString());
                                if (scanCount >= 12)
                                {
                                    _exeResult.Status  = false;
                                    _exeResult.Message = "大托盘已装满" + scanCount + "支,无法再次扫描录入!";
                                    return(_exeResult);
                                }
                            }
                            if (palletisok == "False")
                            {
                                int scanCount = int.Parse(KepController.KepHelper.Read(ScanCount).ToString());
                                if (scanCount >= 24)
                                {
                                    _exeResult.Status  = false;
                                    _exeResult.Message = "小托盘已装满" + scanCount + "支,无法再次扫描录入!";
                                    return(_exeResult);
                                }
                            }
                        }
                        if (productSerialIsOk != productSerial)
                        {
                            int scanCount = int.Parse(KepController.KepHelper.Read(ScanCount).ToString());
                            if (scanCount != 0)
                            {
                                _exeResult.Status  = false;
                                _exeResult.Message = "一个托盘内不允许放不同管型!";
                                return(_exeResult);
                            }
                        }

                        KepController.KepHelper.Write(ProductSerial, productSerial);
                        KepController.KepHelper.Write(ProductType, productType);
                        KepController.KepHelper.Write(Pallet, pallet);
                        KepController.KepHelper.Write(IsSprayPainting, isSprayPainting);
                        KepController.KepHelper.Write(IsUpsetting, isUpsetting);
                        KepController.KepHelper.Write(IsFirstVacuum, isFirstVacuum);
                        KepController.KepHelper.Write(IsXray, isXray);
                        //给PLC发送不良信息描述
                        foreach (var key in ErrorCodeHelper.ErrorCodeDic.Keys)
                        {
                            string wkey = ErrorCodeHelper.DescAddrDic[key];
                            // string wval = ErrorCodeHelper.ErrorCodekeyDic[key];
                            string wval = key.Substring(key.LastIndexOf('-') + 1);
                            KepController.KepHelper.Write(wkey, wval);
                        }
                        KepController.KepHelper.Write(ErrorCodeDescCount, ErrorCodeHelper.ErrorCodeDic.Count);
                        #region 判断发送PLC值是否正确
                        var productSerialok = (KepController.KepHelper.Read(ProductSerial) ?? "").ToString();
                        if (productSerial != productSerialok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送管型序号失败!";
                            return(_exeResult);
                        }
                        var productTypeok = (KepController.KepHelper.Read(ProductType) ?? "").ToString();
                        if (productType != productTypeok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送管型失败!";
                            return(_exeResult);
                        }
                        var palletok = (KepController.KepHelper.Read(Pallet) ?? "").ToString();
                        if (pallet != palletok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送托盘类型失败!";
                            return(_exeResult);
                        }
                        var isSprayPaintingok = (KepController.KepHelper.Read(IsSprayPainting) ?? "").ToString();
                        if (isSprayPainting != isSprayPaintingok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送是否喷漆失败!";
                            return(_exeResult);
                        }

                        var isUpsettingok = (KepController.KepHelper.Read(IsUpsetting) ?? "").ToString();
                        if (isUpsetting != isUpsettingok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送是否墩粗失败!";
                            return(_exeResult);
                        }

                        var isFirstVacuumok = (KepController.KepHelper.Read(IsFirstVacuum) ?? "").ToString();
                        if (isFirstVacuum != isFirstVacuumok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送是否第一次真空度失败!";
                            return(_exeResult);
                        }

                        var isXrayok = (KepController.KepHelper.Read(IsXray) ?? "").ToString();
                        if (isXray != isXrayok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送是否x射线失败!";
                            return(_exeResult);
                        }

                        var errorCodeDescCountok = (KepController.KepHelper.Read(ErrorCodeDescCount) ?? "").ToString();
                        if (ErrorCodeHelper.ErrorCodeDic.Count.ToString() != errorCodeDescCountok)
                        {
                            _exeResult.Status  = false;
                            _exeResult.Message = "发送不良描述总数失败!";
                            return(_exeResult);
                        }
                        #endregion


                        if (_exeResult.Status)
                        {
                            _exeResult = _updateStationController.InsertSnToQulity(sn, isSprayPainting, isUpsetting);
                        }
                        if (_exeResult.Status)
                        {
                            _exeResult = _updateStationController.UpdateStationInfo(sn, stationName, "0");
                        }


                        KepController.KepHelper.Write(ScanFinish, 1);
                        if (_exeResult.Status)
                        {
                            _exeResult.Message = "管号:" + sn + "过站成功!";
                        }
                    }
                    else
                    {
                        _exeResult.Status  = false;
                        _exeResult.Message = "未连接KEP服务器!";
                        return(_exeResult);
                    }
                }
            }
            catch (Exception e)
            {
                _exeResult.Status  = false;
                _exeResult.Message = e.Message;
            }
            return(_exeResult);
        }
        public override ExecutionResult Check(object dataParam)
        {
            var exeResult = (ExecutionResult)dataParam;

            try
            {
                string sn           = exeResult.Sn;
                string stationName  = exeResult.StationName;
                bool   mode         = exeResult.IsAlive;
                string cproductType = exeResult.ProductType;
                if (sn == "")
                {
                    exeResult.Status  = false;
                    exeResult.Message = "管号为空!";
                    return(exeResult);
                }
                if (stationName == "")
                {
                    exeResult.Status  = false;
                    exeResult.Message = "站点名为空!";
                    return(exeResult);
                }

                exeResult = _routeController.CheckSn(stationName, sn, mode);
                if (exeResult.Status)
                {
                    #region 查询管型编号
                    string productSerial = "";

                    if (exeResult.Status)
                    {
                        exeResult = _routeController.GetProductSerial(sn);

                        if (exeResult.Status)
                        {
                            productSerial = (string)exeResult.Anything;
                        }
                        if (!exeResult.Status)
                        {
                            return(exeResult);
                        }
                    }

                    #endregion
                    #region 查询管型
                    string productType = "";
                    if (exeResult.Status)
                    {
                        exeResult = _routeController.GetProductType(sn);
                        if (exeResult.Status)
                        {
                            productType = (string)exeResult.Anything;
                            if (productType != cproductType)
                            {
                                exeResult.Message = "产线管型:" + cproductType + "与上线维护管型:" + productType + "不一致";
                                exeResult.Status  = false;
                                return(exeResult);
                            }
                        }
                        if (!exeResult.Status)
                        {
                            return(exeResult);
                        }
                    }
                    #endregion
                    #region 查询托盘大小

                    string pallet = "";
                    if (exeResult.Status)
                    {
                        exeResult = _routeController.GetPalletByProductType(productType);
                        if (exeResult.Status)
                        {
                            pallet = (string)exeResult.Anything;
                            if (pallet == "1")
                            {
                                pallet = "True";
                            }
                            else
                            {
                                pallet = "False";
                            }
                        }
                        if (!exeResult.Status)
                        {
                            return(exeResult);
                        }
                    }
                    #endregion
                    if (KepController.KepHelper != null && KepController.KepHelper.State)
                    {
                        var autorun = (KepController.KepHelper.Read(AutoRun) ?? "").ToString();
                        if (autorun == "False")
                        {
                            exeResult.Status  = false;
                            exeResult.Message = "线体不在自动运行模式,无法扫描录入!";
                            return(exeResult);
                        }
                        var badMode = (KepController.KepHelper.Read(BadMode) ?? "").ToString();
                        if (badMode == "True")
                        {
                            exeResult.Status  = false;
                            exeResult.Message = "线体在废品上线模式,无法扫描录入!";
                            return(exeResult);
                        }
                        var productSerialIsOk = (KepController.KepHelper.Read(ProductSerial) ?? "").ToString();

                        if (productSerialIsOk == productSerial)
                        {
                            var palletisok = (KepController.KepHelper.Read(Pallet) ?? "").ToString();
                            if (palletisok == "True")
                            {
                                int scanCount = int.Parse(KepController.KepHelper.Read(ScanCount).ToString());
                                if (scanCount >= 12)
                                {
                                    exeResult.Status  = false;
                                    exeResult.Message = "大托盘已装满" + scanCount + "支,无法再次扫描录入!";
                                    return(exeResult);
                                }
                            }
                            if (palletisok == "False")
                            {
                                int scanCount = int.Parse(KepController.KepHelper.Read(ScanCount).ToString());
                                if (scanCount >= 24)
                                {
                                    exeResult.Status  = false;
                                    exeResult.Message = "小托盘已装满" + scanCount + "支,无法再次扫描录入!";
                                    return(exeResult);
                                }
                            }
                        }
                        if (productSerialIsOk != productSerial)
                        {
                            int scanCount = int.Parse(KepController.KepHelper.Read(ScanCount).ToString());
                            if (scanCount != 0)
                            {
                                exeResult.Status  = false;
                                exeResult.Message = "一个托盘内不允许放不同管型!";
                                return(exeResult);
                            }
                        }
                        KepController.KepHelper.Write(ProductSerial, productSerial);
                        KepController.KepHelper.Write(Pallet, pallet);
                        var productSerialok = (KepController.KepHelper.Read(ProductSerial) ?? "").ToString();
                        if (productSerial != productSerialok)
                        {
                            exeResult.Status  = false;
                            exeResult.Message = "发送管型序号失败!";
                            return(exeResult);
                        }
                        var palletok = (KepController.KepHelper.Read(Pallet) ?? "").ToString();
                        if (pallet != palletok)
                        {
                            exeResult.Status  = false;
                            exeResult.Message = "发送托盘类型失败!";
                            return(exeResult);
                        }

                        KepController.KepHelper.Write(ScanFinish, 1);
                        exeResult = _updateStationController.UpdateStationInfo(sn, stationName, "0");
                        if (exeResult.Status)
                        {
                            exeResult.Message = "管号:" + sn + "过站成功!";
                        }
                    }
                    else
                    {
                        exeResult.Status  = false;
                        exeResult.Message = "未连接KEP服务器!";
                        return(exeResult);
                    }
                }
            }
            catch (Exception e)
            {
                exeResult.Status  = false;
                exeResult.Message = e.Message;
            }
            return(exeResult);
        }