服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-12-05 59699130c599acde05f34a0a42f1e42f95d567d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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;
using System.ComponentModel;
 
namespace Tiger.Business.MES.Transaction
{
    /// <summary>
    /// 入库单事务
    /// </summary>
    public class InStoreOrderNo : MESTransactionBase, IInStoreOrderNo
    {
        private readonly IMES_U9C _IMES_U9C = DI.Resolve<IMES_U9C>();
        public IInStoreOrderNo 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 string CurSmtCode { get; set; }
        public string CurrSlotNo { get; set; }
 
        #endregion Propertys & Variables
 
        #region Functions
 
        /// <summary>
        /// 扫描条码上料
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<ApiAction<SmtLoadingReturn>> ScanItem(SmtLoadingInput input)
        {
            var action = new ApiAction<SmtLoadingReturn>();
            try
            {
                if (input.Code.IsNullOrEmpty())
                {
                    action.IsSuccessed = false;
                    //action.LocaleMsg = Biz.L($"{EnumHelper.GetEnum<Step_Types>(input.Step).GetDesc()}不能为空");
                    return action;
                }
 
               
            }
            catch (Exception ex)
            {
                action.CatchExceptionWithLog(ex, $"扫描物料[{input.Code}]复核异常");
            }
            return action;
        }
 
        
 
        #endregion Functions
 
        public override bool Close(bool needSaveHistoryLog = false)
        {
            //needSaveHistoryLog = true;
            //保存操作日志
 
            this.IsFinished = true;
            return IsFinished ? base.Close(needSaveHistoryLog) : IsFinished;
        }
    }//endClass
}