智能立体仓储WMS库位分配C#实现

using System;
using System.Collections.Generic;
using Mirle.Def;
using System.Data;
using DataBase;

namespace DB.WMS.Fun
{
    public class clsLocMst
    {
        /// <summary>
        /// 確認儲位是否是外儲位
        /// </summary>
        /// <param name="sLoc"></param>
        /// <param name="IsOutside"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        public int CheckLocIsOutside(string sLoc, ref bool IsOutside, ref string sLocDD, ref bool IsEmpty_DD, ref string BoxID_DD, DataBase.DB db)
        {
            try
            {
                int iRet = CheckLocIsOutside(sLoc, ref IsOutside, db);
                if (iRet == DBResult.Success)
                {
                    sLocDD = GetLocDD(sLoc, db);
                    if (string.IsNullOrWhiteSpace(sLocDD))
                        throw new Exception($"找不到{sLoc}的對照儲位!");
                    return CheckLocIsEmpty(sLocDD, ref IsEmpty_DD, ref BoxID_DD, db);
                }

                return iRet;
            }
            catch (Exception ex)
            {
                var cmet = System.Reflection.MethodBase.GetCurrentMethod();
                clsWriLog.Log.subWriteExLog(cmet.DeclaringType.FullName + "." + cmet.Name, ex.Message);
                return DBResult.Exception;
            }
        }

        /// <summary>
        /// 確認儲位是否是外儲位
        /// </summary>
        /// <param name="sLoc"></param>
        /// <param name="IsOutside"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        public int CheckLocIsOutside(string sLoc, ref bool IsOutside, DataBase.DB db)
        {
            DataTable dtTmp = new DataTable();
            try
            {
                string strEM = "";
                string strSql = $"select IS_INSIDE from {Parameter.clsLocMst.TableName} where {Parameter.clsLocMst.Column.Loc} = '{sLoc}' ";
                int iRet = db.GetDataTable(strSql, ref dtTmp, ref strEM);
                if (iRet == DBResult.Success)
                {
                    IsOutside = Convert.ToString(dtTmp.Rows[0][0]) == "N" ? true : false;
                }
                else
                {
                    clsWriLog.Log.FunWriLog(WriLog.clsLog.Type.Error, $"{strSql} => {strEM}");
                }

                return iRet;
            }
            catch (Exception ex)
            {
                var cmet = System.Reflection.MethodBase.GetCurrentMethod();
                clsWriLog.Log.subWriteExLog(cmet.DeclaringType.FullName + "." + cmet.Name, ex.Message);
                return DBResult.Exception;
            }
            finally
            {
                dtTmp = null;
            }
        }
        public bool FunTestConnection(DataBase.DB db)
        {
            DataTable dtTmp = new DataTable();
            try
            {
                string strEM = "";
                string strSql = $"select TOP (10) {Parameter.clsLocMst.Column.Loc} from {Parameter.clsLocMst.TableName} ";
                int iRet = db.GetDataTable(strSql, ref dtTmp, ref strEM);
                if (iRet == DBResult.Success)
                {
                    return true;
                }
                else
                {
                    clsWriLog.Log.FunWriLog(WriLog.clsLog.Type.Error, $"{strSql} => {strEM}");
                    return false;
                }
            }
            catch (Exception ex)
            {
                var cmet = System.Reflection.MethodBase.GetCurrentMethod();
                clsWriLog.Log.subWriteExLog(cmet.DeclaringType.FullName + "." + cmet.Name, ex.Message);
                return false;
            }
            finally
            {
                dtTmp = null;
            }
        }
        public string GetLocDD(string sLoc, DataBase.DB db)
        {
            DataTable dtTmp = new DataTable();
            try
            {
                string strEM = "";
                string strSql = $"select {Parameter.clsLocMs

  • 28
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
C#开发,可解析WMS服务,并进行浏览,功能强大,GIS开发人员可参考文件列表 Get Capabilities Example ........................\AssemblyInfo.cs ........................\Get Capabilities Example.csproj ........................\GetCapabilitiesExample.cs Get Map Asynch Example ......................\AssemblyInfo.cs ......................\Get Map Asynch Example.csproj ......................\GetMapAsynchExample.cs ......................\GetMapAsynchExample.resx Get Map Example ...............\AssemblyInfo.cs ...............\Get Map Example.csproj ...............\GetMapExample.cs GLOBECapabilities20040423.xml MapAnimation ............\AssemblyInfo.cs ............\Map Animation.csproj ............\MapAnimation.cs ............\MapAnimation.resx WMS Overview Article.html WMS Overview.sln Wms.Client ..........\AssemblyInfo.cs ..........\Capabilities.cs ..........\CLSDFOLD.BMP ..........\DefaultServerDescriptors.xml ..........\DownloadCache.cs ..........\ENTIRNET.BMP ..........\ENTIRNETX.bmp ..........\ENTIRNETX.ICO ..........\ExtensionMap.cs ..........\Layer.cs ..........\OPENFOLD.BMP ..........\PreviewDialog.cs ..........\PreviewDialog.resx ..........\RequestBuilder.cs ..........\Retriever.cs ..........\Server.cs ..........\ServerAddDialog.cs ..........\ServerAddDialog.resx ..........\ServerDescriptor.cs ..........\Wms.Client.csproj ..........\WmsDialog.cs ..........\WmsDialog.resx ..........\WmsException.cs ..........\WmsServerDescriptors.cs ..........\WmsServerDescriptors.xsd WMSBrowser ..........\AssemblyInfo.cs ..........\MapForm.cs ..........\MapForm.resx ..........\WMSBrowser.cs ..........\WMSBrowser.csproj ..........\WMSBrowser.resx
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

softshow1026

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值