111
cjs
2025-06-30 25d5e0519ebde8a72cb5108d191ada41e64c9753
ams/Hanhe.iWCS.TaizhouGEMTwoProtocol/WMSHelper.cs
@@ -164,6 +164,10 @@
            //物料编号:itemCode
            //物料数量:qty
            public string itemCode { get; set; }
            //物料名称
            public string itemName { get; set; }
            //物料规格
            public string itemModel { get; set; }
            //public string itemFeature { get; set; }
            //public string itemState { get; set; }
            //public string ProductionDate { get; set; }
@@ -423,30 +427,34 @@
                        }
                        else
                        {
                            //var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("timeStamp", timeStamp), "TimeCuoInfoCom");
                            //CMMLog.Info($"WMSIn-{startBit}:{ItemCode}:查询条件:timeStamp={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}");
                            //var erpItemTableInfo = MongoDBSingleton.Instance.FindOne<ERPItemTable>(Query.EQ("item_code", time.materialCode), "ERPItemTable");
                            //CMMLog.Info($"WMSIn-{startBit}:查询条件:item_code={time.materialCode},读出 ERPItemTable 表数据为:{JsonConvert.SerializeObject(erpItemTableInfo)}");
                            //if (ItemCode == "time" && time != null && erpItemTableInfo != null)
                            //{
                            //    CMMLog.Info($"WMSIn-{startBit}:time获取时间戳数据为:{time.TimeCuo}!");
                            //    model.data.Add(new ItemData()
                            //    {
                            //        itemCode = time.productModel,
                            //        lotNo = time.lotNo,
                            //        machineNo = time.packingMachineNumber1.ToString(),
                            //        packageCode = time.bagNumber1.ToString(),
                            //        foldingbag = time.isFold1.ToString(),
                            //        timeStamp = int.Parse(time.TimeCuo),
                            //        realWeight = time.realWeight1,
                            //
                            //        Jm_Item_Code = time.materialCode,
                            //        Jm_Item_Name = time.materialName,
                            //        Jm_Item_Model = time.productModel,
                            //        Jm_Item_Unit = time.measurementUnit,
                            //        Jm_Item_Staff = employee_id
                            //    });
                            //}
                            var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("TimeCuo", timeStamp), "TimeCuoInfoComTwo");
                            CMMLog.Info($"WMSIn-{startBit}:{ItemCode}:查询条件:TimeCuo={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}");
                            var erpItemTableInfo = MongoDBSingleton.Instance.FindOne<ERPItemTable>(Query.EQ("item_code", time.materialCode), "ERPItemTable");
                            CMMLog.Info($"WMSIn-{startBit}:查询条件:item_code={time.materialCode},读出 ERPItemTable 表数据为:{JsonConvert.SerializeObject(erpItemTableInfo)}");
                            if (ItemCode == "time" && time != null && erpItemTableInfo != null)
                            {
                                CMMLog.Info($"WMSIn-{startBit}:time获取时间戳数据为:{time.TimeCuo}!");
                                model.data.Add(new ItemData()
                                {
                                    itemCode = erpItemTableInfo.item_spec,
                                    itemName = erpItemTableInfo.item_name,
                                    itemModel = erpItemTableInfo.item_spec,
                                    lotNo = time.lotNo,
                                    machineNo = time.packingMachineNumber.ToString(),
                                    packageCode = time.bagNumber.ToString(),
                                    foldingbag = time.isFold.ToString(),
                                    timeStamp = int.Parse(time.TimeCuo),
                                    realWeight = time.realWeight,
                                    productWeight = time.needWeight.ToString(),
                                    oneTrayWeight = time.realWeight.ToString(),
                                    Jm_Item_Code = erpItemTableInfo.item_code,
                                    Jm_Item_Name = erpItemTableInfo.item_name,
                                    Jm_Item_Model = erpItemTableInfo.item_spec,
                                    Jm_Item_Unit = erpItemTableInfo.item_uom,
                                    Jm_Item_Staff = employee_id
                                });
                            }
                        }
                    }
                    else
@@ -463,7 +471,9 @@
                            string product = !string.IsNullOrEmpty(info.productType) ? info.productType : erpItemTableInfo.item_spec;
                            model.data.Add(new ItemData()
                            {
                                itemCode = product,
                                itemCode = info.materialCode,
                                itemName = erpItemTableInfo.item_name,
                                itemModel = erpItemTableInfo.item_spec,
                                lotNo = info.lotNo,
                                machineNo = info.machineNo,
                                packageCode = info.packageCode,
@@ -633,41 +643,6 @@
                                });
                            }
                        }
                        else
                        {
                            //var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("timeStamp", timeStamp), "TimeCuoInfoCom");
                            //CMMLog.Info($"WMSInTwo-{startBit}:{ItemCode}:查询条件:timeStamp={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}");
                            //if (ItemCode == "time" && time != null)
                            //{
                            //    CMMLog.Info($"WMSInTwo-{startBit}:time获取时间戳数据为:{time.TimeCuo}!");
                            //    model.data.Add(new ItemData()
                            //    {
                            //        //1楼拆盘机调WMS获取入库终点,传输时间戳数据(暂定)
                            //        //isFold = time.isFold,
                            //        //packingMachineNumber = time.packingMachineNumber,
                            //        itemCode = time.productModel,
                            //        lotNo = time.lotNo,
                            //        machineNo = time.packingMachineNumber1.ToString(),
                            //        packageCode = time.bagNumber1.ToString(),
                            //        //palletLayers = time.bagNumber1.ToString(),
                            //        foldingbag = time.isFold1.ToString(),
                            //        //totalWeight = time.totalWeight,
                            //        timeStamp = int.Parse(time.TimeCuo),
                            //        //productType = time.productModel,
                            //        //bagNumber = time.bagNumber,
                            //        //needWeight = time.needWeight,
                            //        realWeight = time.realWeight1,
                            //        //batchNumber = time.batchNumber,
                            //        //totalCount = time.totalCount,
                            //
                            //        Jm_Item_Code = time.materialCode,
                            //        Jm_Item_Name = time.materialName,
                            //        Jm_Item_Model = time.productModel,
                            //        Jm_Item_Unit = time.measurementUnit,
                            //        Jm_Item_Staff = employee_id
                            //    });
                            //}
                        }
                    }
                    else
@@ -681,10 +656,11 @@
                            CMMLog.Info($"WMSInTwo-{startBit}:查询条件:item_code={info.materialCode},读出 ERPItemTable 表数据为:{JsonConvert.SerializeObject(erpItemTableInfo)}");
                            model.locationGear = info.secondNg.ToString();
                            model.trayCode = info.trayCode;
                            string product = !string.IsNullOrEmpty(info.productType) ? info.productType : erpItemTableInfo.item_spec;
                            model.data.Add(new ItemData()
                            {
                                itemCode = product,
                                itemCode = erpItemTableInfo.item_spec,
                                itemName = erpItemTableInfo.item_name,
                                itemModel = erpItemTableInfo.item_spec,
                                lotNo = info.lotNo,
                                machineNo = info.machineNo,
                                packageCode = info.packageCode,