111
cjs
2025-07-08 62f58ae538c32889a9adae09cf54543f00eb9fea
111
3个文件已修改
36 ■■■■ 已修改文件
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/MESHelper.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/PLCControl.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/WMSHelper.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/MESHelper.cs
@@ -294,6 +294,10 @@
            /// </summary>
            public string oneTrayWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——托盘类型:32位整数
            /// </summary>
            public string trayType { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——叠包后实际重量:32位整数
            /// </summary>
            public string addWeight { get; set; } = "0";
@@ -382,7 +386,7 @@
            /// </summary>
            //public string trayCodeWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——单托毛种:32位整数
            /// 设备通道数据2——单托毛重:32位整数
            /// </summary>
            public string oneTrayWeight1 { get; set; } = "0";
            /// <summary>
@@ -394,6 +398,10 @@
            /// </summary>
            public string oneTrayWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——托盘类型:32位整数
            /// </summary>
            public string trayType { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——叠包后实际重量:32位整数
            /// </summary>
            public string addWeight { get; set; } = "0";
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/PLCControl.cs
@@ -2007,7 +2007,7 @@
                //RegisterReadInPut 读取输入寄存器还是输出寄存器待定,读取通道1的数据
                var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
                {
                    dataNum = 1,
                    dataNum = 2,
                    addr = plc.readAddr+1,
                    host = plc.ip,
                    port = plc.port
@@ -2022,7 +2022,10 @@
                        {
                            string wmstaskno = "";
                            string traycode = "";
                            bool req = WMSHelper.WMSEmptyOut(plc.location, "", ref wmstaskno, ref traycode);
                            string trayType = "";
                            if (result.result[1] == 1) trayType = "田字托";
                            else trayType = "川字托";
                            bool req = WMSHelper.WMSEmptyOut(plc.location, "",trayType, ref wmstaskno, ref traycode);
                            if (req) CMMLog.Debug($"调用WMS获取三楼拆盘机生成任务成功!");
                            else CMMLog.Debug($"调用WMS获取三楼拆盘机生成任务失败!");
                        }
@@ -3014,7 +3017,7 @@
                    info.productWeight = Convert.ToInt32(Completion(result[4]) + Completion(result[5]), 2).ToString();
                    info.oneTrayWeight1 = Convert.ToInt32(Completion(result[6]) + Completion(result[7]), 2).ToString();
                    info.oneTrayWeight = Convert.ToInt32(Completion(result[8]) + Completion(result[9]), 2).ToString();
                    //info.oneTrayWeight = Convert.ToInt32(Completion(result[10]) + Completion(result[11]), 2).ToString();
                    info.trayType = Convert.ToInt32(Completion(result[10]), 2).ToString();
                    info.addState = Convert.ToInt32(Completion(result[11]), 2);
                    info.packageCode = Convert.ToInt32(Completion(result[12]), 2).ToString();
@@ -3026,7 +3029,7 @@
                    
                    CMMLog.Info($"数据处理流程:获取MODBUS转换后的数据信息:location:{info.location},trayCode:{info.trayCode},productWeight:{info.productWeight}" +
                        $",oneTrayWeight1:{info.oneTrayWeight1},oneTrayWeight:{info.oneTrayWeight} "+
                        $",oneTrayWeight1:{info.oneTrayWeight1},oneTrayWeight:{info.oneTrayWeight},trayType:{info.trayType} "+
                        $"addState:{info.addState},packageCode:{info.packageCode}");
                    #endregion
@@ -3082,7 +3085,7 @@
                    var query1 = Query.And(Query.EQ("machineNo", location), Query.EQ("trayCode", "0"));
                    UpdateBuilder updateBuider = Update.Set("location", info.location).
                        Set("trayCode", info.trayCode).Set("productWeight", info.productWeight).
                        Set("oneTrayWeight", info.oneTrayWeight).Set("oneTrayWeight1", info.oneTrayWeight1).
                        Set("oneTrayWeight", info.oneTrayWeight).Set("oneTrayWeight1", info.oneTrayWeight1).Set("trayType", info.trayType).
                        Set("addWeight", info.addWeight).Set("packNg", info.packNg).Set("secondNg", info.secondNg).Set("addState", info.addState).
                        Set("packageCode", info.packageCode).Set("jsonData", json).Set("modify", DateTime.Now);
                    MongoDBSingleton.Instance.Update<MachineInfo>(query1, updateBuider, "MachineInfo", UpdateFlags.None);
@@ -3100,7 +3103,7 @@
                    {
                        UpdateBuilder updateBuider = Update.Set("location", info.location).
                        Set("trayCode", info.trayCode).Set("productWeight", info.productWeight).
                        Set("oneTrayWeight", info.oneTrayWeight).Set("oneTrayWeight1", info.oneTrayWeight1).
                        Set("oneTrayWeight", info.oneTrayWeight).Set("oneTrayWeight1", info.oneTrayWeight1).Set("trayType", info.trayType).
                        Set("addWeight", info.addWeight).Set("packNg", info.packNg).Set("secondNg", info.secondNg).Set("addState", info.addState).
                        Set("packageCode", info.packageCode).Set("jsonData", json).Set("modify", DateTime.Now);
                        MongoDBSingleton.Instance.Update<MachineInfo>(query2, updateBuider, "MachineInfo", UpdateFlags.None);
@@ -3469,7 +3472,7 @@
                num[b] = Convert.ToInt32(Convert.ToString(int.Parse(machine.oneTrayWeight), 2).PadLeft(32, '0').ToString().Substring(k, 16), 2);
            }
            //for (int b = 10; b <= 11; b++) num[b] = 0;// 叠包后实际重量 && 复称结果 默认:0
            num[10] = string.IsNullOrEmpty(machine.palletLayers) ? 0 : int.Parse(machine.palletLayers);  //是否需要叠托盘
            num[10] = int.Parse(machineInfoTwo.trayType);  //托盘类型
            num[11] = machine.addState; //是否需要叠包
            num[12] = int.Parse(machine.packageCode);  //袋号
            //员工编号
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/WMSHelper.cs
@@ -93,6 +93,10 @@
            /// 托盘码
            /// </summary>
            public string trayCode { get; set; }
            /// <summary>
            /// 托盘类型
            /// </summary>
            public string trayType { get; set; }
            public string locationGear { get; set; }
            public List<ItemData> data { get; set; }
            //public List<TimeData> TimeData { get; set; }
@@ -119,6 +123,7 @@
            public string endBit { get; set; }
            public string trayDimension { get; set; }
            public string needCreateAMSTask { get; set; }
            public string trayType { get; set; }
            public int priority { get; set; }
            //public int isFull { get; set; }
            public string projectCode { get; set; }
@@ -426,6 +431,7 @@
                            //CMMLog.Info($"WMSIn-{startBit}:查询条件:item_code={info.materialCode},读出 ERPItemTable 表数据为:{JsonConvert.SerializeObject(erpItemTableInfo)}");
                            model.locationGear = info.secondNg.ToString();
                            model.trayCode = info.trayCode;
                            model.trayType = info.trayType == "1" ? "田字托" : info.trayType == "2" ? "川字托" : "";
                            //string product = !string.IsNullOrEmpty(info.productType) ? info.productType : erpItemTableInfo.item_spec;
                            model.data.Add(new ItemData()
                            {
@@ -547,7 +553,7 @@
            return result;
        }
        public static bool WMSEmptyOut(string endBit, string ItemCode, ref string taskNo, ref string trayCode)
        public static bool WMSEmptyOut(string endBit, string ItemCode,string trayType, ref string taskNo, ref string trayCode)
        {
            bool result = false;
            HardwareAccessObject hao = HardwareAccessHelper.Instance.GetEquipmentsHAO(Constants.WMS_DEVICE_TYPE_WMS);
@@ -559,6 +565,7 @@
                model.endBit = endBit;
                model.projectCode = "glm";
                model.needCreateAMSTask = "Y";
                model.trayType = trayType;
                string msgData = JsonConvert.SerializeObject(model);
                string reqStr = "物料名=" + ItemCode + ";";
                string feedback = "";