wxw
2025-04-14 b1f0187e6bdcc02aceb4989e2d6587c7f3a62440
叠托机申请空托跺绑定
2个文件已修改
123 ■■■■■ 已修改文件
Admin.NET/WCS.Application/PLC/PLCService.cs 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Util/HttpService.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/PLC/PLCService.cs
@@ -1200,55 +1200,59 @@
        #region#实时显示重量到LED屏幕
        var modPosPalletWeightIng = modDevice.listStation.FirstOrDefault(m => m.Text == "实际重量");
        var (resPalletWeightIng, palletWeightValIng) = plcConn.GetPlcDBValue(modPosPalletWeightIng.PosType, modDevice.DbNumber, modPosPalletWeightIng.PlcPos);
        switch (modDevice.StationNum)
        if (modPosPalletWeightIng != null)
        {
            case "094":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight94)
            var (resPalletWeightIng, palletWeightValIng) = plcConn.GetPlcDBValue(modPosPalletWeightIng.PosType, modDevice.DbNumber, modPosPalletWeightIng.PlcPos);
            switch (modDevice.StationNum)
            {
                case "094":
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight94 = Convert.ToDecimal(palletWeightValIng);
                        if (Convert.ToDecimal(palletWeightValIng) != weight94)
                        {
                            LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                            weight94 = Convert.ToDecimal(palletWeightValIng);
                        }
                    }
                }
                break;
            case "160":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight160)
                    break;
                case "160":
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight160 = Convert.ToDecimal(palletWeightValIng);
                        if (Convert.ToDecimal(palletWeightValIng) != weight160)
                        {
                            LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                            weight160 = Convert.ToDecimal(palletWeightValIng);
                        }
                    }
                }
                break;
            case "155":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight155)
                    break;
                case "155":
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight155 = Convert.ToDecimal(palletWeightValIng);
                        if (Convert.ToDecimal(palletWeightValIng) != weight155)
                        {
                            LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                            weight155 = Convert.ToDecimal(palletWeightValIng);
                        }
                    }
                }
                break;
            case "152":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight152)
                    break;
                case "152":
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight152 = Convert.ToDecimal(palletWeightValIng);
                        if (Convert.ToDecimal(palletWeightValIng) != weight152)
                        {
                            LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                            weight152 = Convert.ToDecimal(palletWeightValIng);
                        }
                    }
                }
                break;
            case "153":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight153)
                    break;
                case "153":
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight153 = Convert.ToDecimal(palletWeightValIng);
                        if (Convert.ToDecimal(palletWeightValIng) != weight153)
                        {
                            LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                            weight153 = Convert.ToDecimal(palletWeightValIng);
                        }
                    }
                }
                break;
                    break;
            }
        }
        #endregion
@@ -1442,6 +1446,27 @@
                    var http = new HttpService();
                    string TaskNo = "", EndLocate = "";
                    //根据工位判断是否为叠托机工位申请空托盘跺入库,是:向WMS申请空托盘跺组托
                    string groupMsg = "";
                    if (modDevice.StationNum == "72")
                    {
                        groupMsg = http.BindNullPalletWcs(10, palletVal);
                        if (groupMsg.Contains("-1"))
                        {
                            // 写入输送线退回指令
                            var ret = plcConn.SetPlcDBValue(modDevice.PosType, modDevice.DbNumber, modPosEndLocat.PlcPos, modDevice.StationNum);
                            if (ret.IsSucceed)
                            {
                                plcConn.SetPlcDBValue(modDevice.PosType, modDevice.DbNumber, modDevice.WcsPos, "350");
                            }
                            break;
                        }
                    }
                    //向WMS申请巷道
                    strMsg = http.RequestRoadWay(palletVal, modDevice.StationNum, taskModel, louCeng, ref EndLocate, ref TaskNo, (int)palletHeightVal);
                    if (!strMsg.Contains("-1"))
Admin.NET/WCS.Application/Util/HttpService.cs
@@ -439,4 +439,28 @@
        }
        return returnStr;
    }
    /// <summary>
    /// 叠托机申请空托跺绑定
    /// </summary>
    /// <param name="palletNo"></param>
    /// <returns></returns>
    public string BindNullPalletWcs(int qty,string palletNo)
    {
        string returnStr = "";
        var model = new
        {
            PalletNo = palletNo,
            Qty = qty,
        };
        string url = Urls.WMSAddress + ":" + Urls.WMSPort;
        var result = (url + "/api/DownAPi/BindNullPalletWcs").SetBody(model, "application/json", Encoding.UTF8).PostAsAsync<ResponseSkuInfo>().Result;
        Log.Information("调用WMS接口叠托机绑定空托跺" + result.ToJson());
        if (result.Success != 0)
        {
            returnStr = "-1:" + result.Message;
        }
        return returnStr;
    }
}