1
schangxiang@126.com
2024-12-02 607fa9a9dec5ff4fe780231d635bbd62e1740f37
CC/iWareCC_ASRS/ThreadService/05_BZ30(ÆëÌ×ÑéÖ¤)/DataProcess_ValidateQiTao.cs
@@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.ServiceModel.Configuration;
using System.Text;
using System.Threading;
@@ -36,7 +37,7 @@
                {
                    if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        var rgvLocation = StationLocationEnum.BZ30.ToString();
                        using (WmsDBModel wmsDB = new WmsDBModel())
                        {
@@ -55,32 +56,37 @@
                            var configValues = configValue.Split('|');
                            var packageCode = configValues[0];
                            var qitaoValue = configValues[1];//齐套  ä¸é½å¥—
                            var _UnlinePerson = configValues[2];
                            bool iscomplete = false;
                            if (qitaoValue.Equals("齐套"))
                            {
                                iscomplete = true;
                            }
                            //TODO:推送给PLC åŽ»å“ªä¸ªæ–¹å‘ï¼Ÿ
                            /*
                            using (StationServiceClient client = new StationServiceClient())
                            {
                                var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.入库模式, rgvLocation);
                                var res = client.WriteQiTaoInfo((int)EDevice.Station, rgvLocation, iscomplete);
                                if (!res.result)
                                {
                                    SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-推送给PLC切换模式 å¤±è´¥,ChangeModeAsync è¿”回:{res.resMsg}";
                                    SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-推送给PLC是否齐套失败,ChangeModeAsync è¿”回:{res.resMsg}";
                                    continue;
                                }
                                else
                                {
                                    Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-推送给PLC切换模式 æˆåŠŸ,ChangeModeAsync,参数: ç«™ç‚¹{rgvLocation}");
                                    Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-推送给PLC是否齐套 æˆåŠŸ,ChangeModeAsync,参数: ç«™ç‚¹{rgvLocation}");
                                }
                            }
                            //*/
                            //
                            //更新值
                            bz30Config.Value = "";
                            var gahter = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault();
                            if (gahter != null)
                            var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault();
                            if (package != null)
                            {
                                gahter.UpiStatus = (int)UpiStatusEnum.已下线;
                                gahter.AreaCode = (int)AreaCodeEnum.下线区域;
                                package.UpiStatus = (int)UpiStatusEnum.已下线;
                                package.AreaCode = (int)AreaCodeEnum.下线区域;
                            }
                            var upiList = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == packageCode).ToList();
                            foreach (var item in upiList)
@@ -95,14 +101,28 @@
                            {
                                wmsDB.mes_package_linequeue.Remove(lineQueue);
                            }
                            //处理表  mes_order_gather
                            var errmsg = "";
                            var result = MyExtendHelper.HandlerOrderGather(wmsDB, package, qitaoValue, _UnlinePerson, out errmsg);
                            if (result == false)
                            {
                                SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = errmsg;
                                continue;
                            }
                            //新增下线记录
                            mes_package_unline_record record = new mes_package_unline_record();
                            record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(gahter);
                            record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(package);
                            record.Id = Yitter.IdGenerator.YitIdHelper.NextId();
                            record.CreateTime = DateTime.Now;
                            record.UpdateTime = DateTime.Now;
                            record.OpRemark = "下线";
                            wmsDB.mes_package_unline_record.Add(record);
                            WmsRecordUpiProcessHandler.SaveWmsRecordPackageProcess(wmsDB, package, "BZ30", "齐套验证");
                            wmsDB.SaveChanges();
@@ -118,5 +138,6 @@
            }
        }
    }
}