服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2025-01-10 7b866428a3aff80684f04f38361b7efb31097f47
新增 ReprintBarcode 类和接口,更新注释

在 `ItemQuery.cs` 文件中,移除了 `生产领料事务` 的注释,添加了 `库存查询事务` 的注释。

在 `ReprintBarcode.cs` 文件中,添加了多个 `using` 语句以引入所需的命名空间,并新增了 `ReprintBarcode` 类。该类继承自 `WMSTransactionBase` 并实现了 `IReprintBarcode` 接口。类中定义了多个属性和方法,包括初始化方法 `Init`、扫描方法 `Scan` 以及关闭方法 `Close`。

在 `IReprintBarcode.cs` 文件中,添加了多个 `using` 语句以引入所需的命名空间,并新增了 `IReprintBarcode` 接口。该接口继承自 `IWMSTransaction`,并定义了初始化方法 `Init`、扫描方法 `Scan` 以及关闭方法 `Close`。
已修改2个文件
已添加2个文件
124 ■■■■■ 文件已修改
Tiger.Api/Language.db 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.WMS/Transaction/ItemQuery.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.WMS/Transaction/ReprintBarcode.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.IBusiness.WMS/Transaction/IReprintBarcode.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Api/Language.db
Binary files differ
Tiger.Business.WMS/Transaction/ItemQuery.cs
@@ -18,7 +18,7 @@
namespace Tiger.Business.WMS.Transaction
{
    /// <summary>
    /// ç”Ÿäº§é¢†æ–™äº‹åŠ¡
    /// åº“存查询事务
    /// </summary>
    public class ItemQuery : WMSTransactionBase, IItemQuery
    {
Tiger.Business.WMS/Transaction/ReprintBarcode.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
using Rhea.Common;
using Tiger.Model.Minsun;
using Microsoft.AspNetCore.Http;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Tiger.Model;
using Apache.NMS;
using System.Drawing.Drawing2D;
using Tiger.Model.Sharetronic.Shelf;
using Tiger.IBusiness;
namespace Tiger.Business.WMS.Transaction
{
    /// <summary>
    /// æŸ¥å‚¨ä½è¡¥å°æ¡ç äº‹åŠ¡
    /// </summary>
    public class ReprintBarcode : WMSTransactionBase, IReprintBarcode
    {
        public IReprintBarcode Init(string id, string userCode, string apiHost, string orgCode)
        {
            TransID = id;
            UserCode = userCode;
            ApiHost = apiHost;
            OrgCode = orgCode;
            Logger.Console.Info($"Start {this.GetType().Name} Transaction[ID: {TransID}]");
            return this;
        }
        #region Propertys & Variables
        public string UserCode { get; set; }
        public long UserId { get; set; }
        public string OrgCode { get; set; }
        public List<SuggestItem> Suggests { get; set; } = new();
        public List<V_WMS_ITEM> Vitem { get; set; } = new();
        public List<WMS_ITEM_POOL> CurPoolList => Suggests.Where(q => !q.poolItem.IsNullOrEmpty()).Select(q => q.poolItem).ToList();
        public Inventory CurInv { get; set; }
        public BIZ_ERP_PROD_OUT req { get; set; }
        public ReqType CurReqType { get; set; }
        public List<BIZ_ERP_PROD_OUT_DTL> dtls { get; set; } = new();
        public bool isExceed { get; set; }
        public ProductionPickToMes toMes { get; set; }
        public bool his_isComplete { get; set; }
        public bool isCutting { get; set; }
        public decimal cutQty { get; set; }
        public BIZ_WMS_TRANSFER transferH = null;
        public BIZ_WMS_TRANSFER cTransferH = null;
        public BIZ_WMS_TRANSFER_DTL transferDtl = null;
        public BIZ_WMS_TRANSFER_SN transferSn = null;
        #endregion
        #region Functions
        /// <summary>
        /// æ‰«æå…¥å£
        /// </summary>
        public async Task<ApiAction<ScanOutput>> Scan(BaseInput input)
        {
            var action = new ApiAction<ScanOutput>();
            try
            {
                if (input.SN.IsNullOrEmpty())
                {
                    action.IsSuccessed = false;
                    action.LocaleMsg = Biz.L("WMS.RePrint.ScanItem.SnEmptyFailure");
                    return SetOutPutMqttMsg(action, input.Locale);
                }
                var whUnit = await Biz.Db.Queryable<V_WH_UNIT>().Where(t => (t.SHELF_CODE.ToUpper() == input.SN || t.LOCATION_CODE.ToUpper() == input.SN) && t.AUTH_ORG == OrgCode).IncludesAllFirstLayer().FirstAsync();
            }
            catch (Exception ex)
            {
                //取消当前操作
                ResetInfo();
                //action.CatchExceptionWithLog(ex, $"扫描[{input.SN}]异常");
                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.Scan.ScanException", input.SN));
            }
            return SetOutPutMqttMsg(action, input.Locale);
        }
        #endregion
        public override bool Close(bool needSaveHistoryLog = false)
        {
            needSaveHistoryLog = true;
            //保存操作日志
            this.IsFinished = true;
            return IsFinished ? base.Close(needSaveHistoryLog) : IsFinished;
        }
    }//endClass
}
Tiger.IBusiness.WMS/Transaction/IReprintBarcode.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
using Rhea.Common;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Tiger.Model;
using Tiger.Model.Sharetronic.Shelf;
namespace Tiger.IBusiness
{
    public interface IReprintBarcode : IWMSTransaction
    {
        public IReprintBarcode Init(string id, string userCode, string apiHost, string orgCode);
        public Task<ApiAction<ScanOutput>> Scan(BaseInput input);
        public bool Close(bool needSaveHistoryLog = false);
    }
}