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 RePrintLabel : WMSTransactionBase, IRePrintLabel
|
{
|
public IRePrintLabel 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<V_WMS_ITEM> Vitem { get; set; } = new();
|
public Inventory CurInv { get; set; }
|
|
#endregion
|
|
#region Functions
|
/// <summary>
|
/// 扫描入口
|
/// </summary>
|
public async Task<ApiAction<ScanOutput>> Scan(BaseInput input)
|
{
|
var action = new ApiAction<ScanOutput>(new 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)
|
{
|
//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
|
}
|