服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-04 9da68fc16ccd0fba6472096ae298e4bcdf5d12b8
Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
@@ -18,6 +18,7 @@
using System.Drawing.Printing;
using System.Net.NetworkInformation;
using Tiger.Model.MES.Yada;
using static Microsoft.CodeAnalysis.CSharp.SyntaxTokenParser;
namespace Tiger.Business.MES
{
@@ -608,10 +609,10 @@
                if (db.Queryable<mes_ShipList>().Any(q => q.MoDoc.Equals(wo) && SqlFunc.DateIsSame(q.BusinessDate, DateTime.Now) && q.Status == 2 && q.Org == org.ID.ToInt64()))
                {
                    result.Data = "Customer";
                    result.LocaleMsg = new($"出货信息存在!");
                }
                else
                {
                    result.LocaleMsg = new($"出货信息存在!");
                    result.Data = "InStoreLabel";
                }
            }
@@ -621,5 +622,32 @@
            }
            return result;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="SN"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        public async Task<ApiAction> UnbindWipSnFromWO(UnbindWipSnInput input)
        {
            var result = new ApiAction();
            try
            {
                var wipList = await Biz.Db.Queryable<MES_WIP_DATA>().Where(q => q.SN.Equals(input.SN) || q.FLOW_SN.Equals(input.SN)).ToListAsync();
                if (wipList.Count == 0)
                {
                    result.IsSuccessed = false;
                    result.LocaleMsg = new($"解绑的条码不存在当前操作表中!");
                }
                var wo = await Biz.Db.Queryable<BIZ_MES_WO>().Where(q => q.ORDER_NO == wipList[0].WORK_ORDER).FirstAsync();
                result = WorkBatch.UnbindWipSnFromWO(wo, wipList, input.user);
            }
            catch (Exception ex)
            {
                result.CatchExceptionWithLog(ex, "解绑条码异常");
            }
            return result;
        }
    }
}