¶Ô±ÈÐÂÎļþ |
| | |
| | | using Rhea.Common; |
| | | using Tiger.IBusiness; |
| | | 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 Tiger.Model.Sharetronic.Shelf; |
| | | |
| | | namespace Tiger.Business.MES.Transaction |
| | | { |
| | | /// <summary> |
| | | /// SMT䏿è°åº¦äºå¡ |
| | | /// </summary> |
| | | public class LoadingMaterial : MESTransactionBase, ILoadingMaterial |
| | | { |
| | | public ILoadingMaterial 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 bool his_isComplete { get; set; } |
| | | public bool isManual { get; set; } |
| | | public decimal cutQty { get; set; } |
| | | |
| | | #endregion Propertys & Variables |
| | | |
| | | #region Functions |
| | | |
| | | /// <summary> |
| | | /// æ«ææ¡ç 䏿 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<ProdReqOutput>> ScanItem(BaseCodeInput input) |
| | | { |
| | | var action = new ApiAction<ProdReqOutput>(); |
| | | try |
| | | { |
| | | if (input.Code.IsNullOrEmpty()) |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = Biz.L("æ¡ç ä¸è½ä¸ºç©º"); |
| | | return action; |
| | | } |
| | | |
| | | //action.Data = new ProdReqOutput() |
| | | //{ |
| | | // SN = CurInv.SN, |
| | | // ItemCode = CurInv.ItemInfo.ITEM_CODE, |
| | | // Qty = CurInv.CurPkg.QTY, |
| | | // CutQty = CurInv.CurPkg.QTY - cutQty, |
| | | // isCutting = isCutting, |
| | | // isExceed = isExceed, |
| | | // ReqNo = req.BILLCODE, |
| | | // regionCode = CurInv.Region.REGION_CODE, |
| | | // locationCode = CurInv.Location?.LOCATION_CODE, |
| | | //}; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, $"æ«æç©æ[{input.Code}]夿 ¸å¼å¸¸"); |
| | | } |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å ä¸ä¸ªApiActionçåå²è®°å½ |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public override void AddHistory<T>(Microsoft.AspNetCore.Http.HttpRequest request, ApiAction<T> action) |
| | | { |
| | | var his = action.History(); |
| | | //his.TraceDic.Add("CurReqType", CurReqType); |
| | | //his.TraceDic.Add("CurInv", CurInv); |
| | | //his.TraceDic.Add("req", req); |
| | | //his.TraceDic.Add("toMes", toMes); |
| | | //his.TraceDic.Add("CurPoolList", CurPoolList); |
| | | //his.TraceDic.Add("isComplete", his_isComplete); |
| | | //ActionHistoryList.Add($"{request.HttpContext.TraceIdentifier} at {action.Timestamp:yyyy/MM/dd HH:mm:ss.fff}: {request.Path}", his); |
| | | LastActionTime = DateTime.Now; |
| | | } |
| | | |
| | | #endregion Functions |
| | | |
| | | public override bool Close(bool needSaveHistoryLog = false) |
| | | { |
| | | //needSaveHistoryLog = true; |
| | | //ä¿åæä½æ¥å¿ |
| | | |
| | | this.IsFinished = true; |
| | | return IsFinished ? base.Close(needSaveHistoryLog) : IsFinished; |
| | | } |
| | | }//endClass |
| | | } |