コード例 #1
0
ファイル: PTC.cs プロジェクト: wuyunhai/EasyCareAuto
        /// <summary>
        /// 产品条码校验
        /// </summary>
        /// <param name="_session"></param>
        /// <param name="_transData"></param>
        private void ExecutePTC(MesSession _session, TransData _transData)
        {
            //1、参数校验---缓存产品条码---------------------------------
            string cacheSN = string.Empty;

            if (!EmployeeComm.CheckNormalParam(_session, _transData, "OP010_SN_CHECK", out cacheSN, "缓存产品条码", EmployeeName))
            {
                return;
            }

            //2、判断条码是否匹配 ---------------------------------
            LogInfo log = null;

            if (cacheSN != _transData.SN)
            {
                log = new SocketService.LogInfo(_session, LogLevel.Error, $"[{_transData.SN}]执行【{EmployeeName}】接口失败>> 请求校验条码:{_transData.SN},缓存条码:{cacheSN}。");
                _transData.ProcessData = $"Bar Code validation failed, request validation BarCode: {_transData.SN}, Cache BarCode: {cacheSN}";
                EmployeeComm.SendMsg(_session, _transData, CheckResult.NG);
                return;
            }

            //3、API执行成功  ---------------------------------
            log = new SocketService.LogInfo(_session, LogLevel.Info, $"[{_transData.SN}]执行【{EmployeeName}】接口成功>> 请求校验条码:{_transData.SN},缓存条码:{cacheSN}。");
            EmployeeComm.SendMsg(_session, _transData, CheckResult.OK);
        }