22
schangxiang@126.com
2024-12-15 1f6ee76c23f0324dc744c78e5e428eda6604e0b6
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;
@@ -34,7 +35,8 @@
                SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = string.Empty;
                try
                {
                    if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
                    //if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
                    if (SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ30.ToString();
@@ -55,6 +57,7 @@
                            var configValues = configValue.Split('|');
                            var packageCode = configValues[0];
                            var qitaoValue = configValues[1];//齐套  ä¸é½å¥—
                            var _UnlinePerson = configValues[2];
                            bool iscomplete = false;
                            if (qitaoValue.Equals("齐套"))
                            {
@@ -80,11 +83,11 @@
                            //更新值
                            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)
@@ -99,14 +102,33 @@
                            {
                                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.Id = Yitter.IdGenerator.YitIdHelper.NextId();
                            record.CreateTime = DateTime.Now;
                            record.UpdateTime = DateTime.Now;
                            record.OpRemark = "下线";
                            wmsDB.mes_package_unline_record.Add(record);
                            //判断如果包已经下线了,就不再写入下线记录了
                            var existPackObj = wmsDB.mes_package_unline_record.Where(x => x.PackageCode == package.PackageCode).FirstOrDefault();
                            if (existPackObj == null)
                            {
                                mes_package_unline_record record = new mes_package_unline_record();
                                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();
@@ -122,5 +144,6 @@
            }
        }
    }
}