111
cjs
2025-05-30 251e0a3deb75c529fa35408be4ce5bb6e46a01f0
ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs
@@ -981,7 +981,7 @@
                        if (req)
                        {
                            ProcessHelper.deleteInfo(plc.location + "-复称入缓存架");
                            ProcessHelper.deleteInfo(plc.location + "-复称下线");
                            var queryList = MongoDBSingleton.Instance.Find<packageInfoModel>(Query.And(Query.EQ("machineNo", model.machince), Query.EQ("trayCode", model.ext2), Query.EQ("weight2", "")), "packageInfoModel");
                            if (queryList.Count > 0)
                            {
@@ -1027,6 +1027,10 @@
                                MongoDBSingleton.Instance.Update<ProductList>(Query.And(Query.EQ("Date", DateTime.Now.ToString("yyyy-MM-dd")), Query.EQ("machine", model.machince)), Update.Set("percentOfPass", proInfo.percentOfPass).Set("qualifiedQuantity", proInfo.qualifiedQuantity), UpdateFlags.None);
                            }
                        }
                        else
                        {
                            ProcessHelper.recordInfo(plc.location + "-复称下线", "当前半成品库区未获取到可用货位,检查是否已满");
                        }
                    }
                    if (result.result[2] == 2)
@@ -1037,7 +1041,7 @@
                        req = WMSHelper.WMSIn(plc.location, model.ext2, ref wmstaskno, ref traycode, timeStamp);
                        if (req)
                        {
                            ProcessHelper.deleteInfo(plc.location + "-复称入缓存架");
                            ProcessHelper.deleteInfo(plc.location + "-复称下线");
                            var wirte = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel
                            {
                                addr = plc.writeAddr + 3,
@@ -1083,7 +1087,11 @@
                                else CMMLog.Debug($"packageInfoModel未找到数据,machineNo:{model.machince},trayCode:{model.ext2}");
                            }
                        }
                        else CMMLog.Debug($"复称入缓存架NG流程:WMS生成任务失败!");
                        else
                        {
                            ProcessHelper.recordInfo("复称下线", "当前NG库区未获取到可用货位,检查是否已满");
                            CMMLog.Debug($"复称入缓存架NG流程:WMS生成任务失败!");
                        }
                    }
                    string PlcBit02 = Settings.GetPlcInfo().Where(a => a.deviceType == "2").FirstOrDefault().location;
                    UpdateBuilder update = Update.Set("ng", result.result[2]);
@@ -1501,6 +1509,7 @@
                            string ChangeBit = WMSHelper.WmsUpdateWay(taskInfo.CN_S_SOURCE_NO, plc.Extend);
                            if (!string.IsNullOrEmpty(ChangeBit))
                            {
                                ProcessHelper.deleteInfo("叠包NG");
                                CMMLog.Info($"起点:{taskInfo.CN_S_END_BIT}");
                                CMMLog.Info($"终点:{ChangeBit}");
                                int[] parms = { StockInstance.Instance.GetAGVCodeForBitCode(taskInfo.CN_S_END_BIT), StockInstance.Instance.GetAGVCodeForBitCode(ChangeBit) };
@@ -1511,12 +1520,15 @@
                                TSHelper.GoToAGV(taskNo, 10, 8);
                                MongoDBSingleton.Instance.Update<TN_I_TASK_MST>(Query.EQ("CN_S_TASK_NO", taskNo), Update.Set("CN_S_END_BIT", ChangeBit).Set("CN_S_START_BIT", taskInfo.CN_S_END_BIT), "TN_I_TASK_MST", UpdateFlags.None);
                                MongoDBSingleton.Instance.Remove<WMSInfo>(Query.EQ("trayCode", taskInfo.CN_S_BATCH_NO), RemoveFlags.Single);
                            }
                            else CMMLog.Debug($"调用WMS改道接口,未获取到可用点位。");
                            //Console.WriteLine($"读码信息比对结果:条码与传送的数据不一致");
                            else
                            {
                                CMMLog.Debug($"调用WMS改道接口,未获取到可用点位。");
                                ProcessHelper.recordInfo("叠包NG","NG库区未获取到可用货位,检查NG库区是否已满");
                            }
                        }
                        
                    }
@@ -1863,8 +1875,16 @@
                            string wmstaskno = "";
                            string traycode = "";
                            bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode);
                            if (req) CMMLog.Debug($"调用WMS获取三楼叠盘机生成任务成功!");
                            else CMMLog.Debug($"调用WMS获取三楼叠盘机生成任务失败!");
                            if (req)
                            {
                                CMMLog.Debug($"调用WMS获取三楼叠盘机生成任务成功!");
                                ProcessHelper.deleteInfo("叠盘下线");
                            }
                            else
                            {
                                ProcessHelper.recordInfo("叠盘下线", "叠盘机下线库区未查询到可用货位,检查叠盘机下线库区是否已满");
                                CMMLog.Debug($"调用WMS获取三楼叠盘机生成任务失败!");
                            }
                        }
                    }
                }