服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-10-27 582d7ab9eb6879f4b5f3e1b1b7d162f3d53a0e39
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
85
86
87
88
89
90
91
using Rhea.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tiger.Model;
using Tiger.Model.Entitys.MES.Position;
 
namespace Tiger.IBusiness
{
    public interface IPosition : IMESTransaction
    {
        #region Propertys & Variables
        public string UserCode { get; set; }
        public string PostCode { get; set; }
        public MES_FACTORY CurFactory { get; set; }
        public MES_WORKSHOP CurWorkshop { get; set; }
        public MES_LINE CurLine { get; set; }
        public MES_POSITION CurPosition { get; set; }
        public IWorkBatch WorkBatch { get; }
        public List<MES_WIP_DATA> CurWipSNs { get; set; }
        public List<MES_WIP_DATA> LastWipSNs { get; set; }
        public string CurSN { get; }
        public List<MES_WIP_HIS> CurWipSNHiss { get; set; }
        public Dictionary<string, object> Context { get; set; }
        /// <summary>
        /// 是否需要临时存储数据库提交操作,待需要的时候再提交
        /// </summary>
        public bool NeedTemporaryStoreDBCommitAction { get; set; }
        #endregion Propertys & Variables
 
        #region Functions
        /// <summary>
        /// 初始化岗位
        /// </summary>
        /// <param name="id"></param>
        /// <param name="apiHost"></param>
        /// <param name="userCode"></param>
        /// <param name="postCode"></param>
        /// <returns></returns>
        public IPosition Init(string id, string apiHost, string userCode, string postCode);
        /// <summary>
        /// 重置工序操作
        /// </summary>
        /// <returns></returns>
        public ApiAction Reset();
        /// <summary>
        /// 重置工步列表
        /// </summary>
        public void ResetNode();
        /// <summary>
        /// 获取提交数据的DbClient对象
        /// </summary>
        /// <returns></returns>
        public DbClient GetCommitDB();
        /// <summary>
        /// 保存工步的数据库提交操作到数据库
        /// </summary>
        /// <param name="appendAction">保存完工步数据后,附加的保存内容</param>
        public void SaveStepsCommitActionToDB(Action appendAction = null);
        /// <summary>
        /// 获取打印标签模板过程变量值
        /// </summary>
        /// <param name="labelPVs">过程变量列表</param>
        /// <param name="label">标签模板</param>
        /// <returns></returns>
        public BAS_LABEL_TEMP SetLabelVariables(List<BAS_LABEL_PV> labelPVs, BAS_LABEL_TEMP label, IWorkAction action);
        /// <summary>
        /// 获取打印标签模板过程变量值
        /// </summary>
        /// <param name="labelPVs">过程变量列表</param>
        /// <param name="lv">标签模板变量</param>
        /// <returns></returns>
        public string GetPrintProcessValue(List<BAS_LABEL_PV> labelPVs, BAS_LABEL_VAR lv, List<BAS_LABEL_VAR> lvars, IWorkAction action);
        /// <summary>
        /// 根据传入的包装对象返回所有的包装实体列表
        /// </summary>
        /// <param name="parent"></param>
        /// <returns></returns>
        public List<MES_WIP_PKG> GetPackageList(WipPkgItem parent);
        /// <summary>
        /// 获取根据条码规则生成条码
        /// </summary>
        /// <param name="ruleCode"></param>
        /// <param name="curAction"></param>
        /// <returns></returns>
        public string GenerateSN(string ruleCode, IWorkAction curAction);
        #endregion Functions
    }
}