服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-05-15 93427767c06fbe2437abb4389af649c0a9bb3546
smt上料更新
已修改6个文件
103 ■■■■ 文件已修改
Tiger.Api/Controllers/MES/SMTController.Tool.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business/MES/SMT/Biz.SmtTool.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business/MES/Transaction/LoadingMaterial.cs 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.IBusiness/MES/SMT/ISmtTool.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/MES/SMT_WO_TABLE.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Api/Controllers/MES/SMTController.Tool.cs
@@ -15,7 +15,7 @@
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetNotLoadingMaterial([FromBody] ApiAction<smtWoTableParams> action)
        public async Task<IActionResult> GetNotLoadingMaterial([FromBody] ApiAction<SmtLoadingInput> action)
        {
            ApiAction response = new();
            try
Tiger.Business/MES/SMT/Biz.SmtTool.cs
@@ -28,7 +28,7 @@
            /// </summary>
            /// <param name="paras"></param>
            /// <returns></returns>
            public async Task<ApiAction<List<SMT_WO_TABLE>>> GetNotLoadingMaterial(smtWoTableParams paras)
            public async Task<ApiAction<List<SMT_WO_TABLE>>> GetNotLoadingMaterial(SmtLoadingInput paras)
            {
                var res = new ApiAction<List<SMT_WO_TABLE>>();
                List<SMT_WO_TABLE> sList = new List<SMT_WO_TABLE>();
Tiger.Business/MES/Transaction/LoadingMaterial.cs
@@ -34,8 +34,8 @@
        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 string CurrSmtCode { get; set; }
        public string CurrSlotNo { get; set; }
        /// <summary>
        /// 步骤类型
        /// </summary>
@@ -72,9 +72,9 @@
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<ApiAction<ProdReqOutput>> ScanItem(SmtLoadingInput input)
        public async Task<ApiAction> ScanItem(SmtLoadingInput input)
        {
            var action = new ApiAction<ProdReqOutput>();
            var action = new ApiAction();
            try
            {
                if (input.Code.IsNullOrEmpty())
@@ -84,20 +84,56 @@
                    return action;
                }
                //01根据上料步骤执行相应方法
                switch (EnumHelper.GetEnum<Step_Types>(input.Step))
                {
                    case Step_Types.SmtCode:
                        ExecuteSmtCode();
                        action = ExecuteSmtCode(input);
                        break;
                    case Step_Types.SlotNo:
                        ExecuteSlotNo();
                        action = ExecuteSlotNo(input);
                        break;
                    case Step_Types.Feeder:
                        ExecuteFeeder();
                        action = ExecuteFeeder(input);
                        break;
                    case Step_Types.SN:
                        ExecuteSN();
                        action = ExecuteSN(input);
                        break;
                }
                //02保存上料数据
                //03查看未上料列表
                Biz.SmtTool smtTool = new();
                var actionSmtTool = await smtTool.GetNotLoadingMaterial(input);
                if (actionSmtTool.IsSuccessed)
                {
                    //带入机器编码查询,如果没有未上料的项,说明当前机器所有槽位均已完成上料!
                    if (actionSmtTool.Data.Count == 0)
                    {
                        var _input = input.Clone();
                        _input.machineCode = "";
                        action.LocaleMsg = Biz.L($"当前机器所有槽位均已完成上料!");
                        var _actionSmtTool = await smtTool.GetNotLoadingMaterial(_input);
                        if (_actionSmtTool.IsSuccessed)
                        {
                            //不带入机器编码查询,如果没有未上料的项,说明当前线别所有机器均已完成上料!
                            if (_actionSmtTool.Data.Count == 0)
                            {
                                action.LocaleMsg = Biz.L($"当前线别所有机器均已完成上料");
                            }
                        }
                        else
                        {
                            action.IsSuccessed = false;
                            action.LocaleMsg = Biz.L($"获取未上料列表失败!");
                        }
                    }
                }
                else
                {
                    action.IsSuccessed = false;
                    action.LocaleMsg = Biz.L($"获取未上料列表失败!");
                }
                //action.Data = new ProdReqOutput()
@@ -120,11 +156,21 @@
            return action;
        }
        private ApiAction ExecuteSmtCode() {
        private ApiAction ExecuteSmtCode(SmtLoadingInput input) {
            var action = new ApiAction();
            try
            {
                if (Biz.Db.Queryable<SMT_WO_TABLE>().Where(x => x.WORK_ORDER == input.moCode && x.LINE_CODE == input.lineCode && x.PROD_CODE == input.prodCode && x.SMT_CODE == input.Code).Any())
                {
                    CurrSmtCode = input.Code;
                    action.IsSuccessed = true;
                    action.LocaleMsg = Biz.L($"机器编码验证通过!");
                }
                else
                {
                    action.IsSuccessed = false;
                    action.LocaleMsg = Biz.L($"料站表中不存在此机器编码,请确认料站表是否正确上传!");
                }
            }
            catch (Exception ex)
            {
@@ -133,12 +179,22 @@
            return action;
        }
        private ApiAction ExecuteSlotNo()
        private ApiAction ExecuteSlotNo(SmtLoadingInput input)
        {
            var action = new ApiAction();
            try
            {
                if (Biz.Db.Queryable<SMT_WO_TABLE>().Where(x => x.WORK_ORDER == input.moCode && x.LINE_CODE == input.lineCode && x.PROD_CODE == input.prodCode && x.SMT_CODE == CurrSmtCode && x.SLOT_NO == input.Code).Any())
                {
                    CurrSlotNo = input.Code;
                    action.IsSuccessed = true;
                    action.LocaleMsg = Biz.L($"槽位验证通过!");
                }
                else
                {
                    action.IsSuccessed = false;
                    action.LocaleMsg = Biz.L($"此槽位[{input.Code}]不存在或料站表未上传!");
                }
            }
            catch (Exception ex)
            {
@@ -147,7 +203,7 @@
            return action;
        }
        private ApiAction ExecuteFeeder()
        private ApiAction ExecuteFeeder(SmtLoadingInput input)
        {
            var action = new ApiAction();
            try
@@ -161,7 +217,7 @@
            return action;
        }
        private ApiAction ExecuteSN()
        private ApiAction ExecuteSN(SmtLoadingInput input)
        {
            var action = new ApiAction();
            try
Tiger.IBusiness/MES/SMT/ISmtTool.cs
@@ -11,6 +11,6 @@
{
    public interface ISmtTool
    {
        public Task<ApiAction<List<SMT_WO_TABLE>>> GetNotLoadingMaterial(smtWoTableParams paras);
        public Task<ApiAction<List<SMT_WO_TABLE>>> GetNotLoadingMaterial(SmtLoadingInput paras);
    }
}
Tiger.Model.Net/Entitys/MES/SMT_WO_TABLE.cs
@@ -126,12 +126,4 @@
        #endregion
    }//endClass
    public class smtWoTableParams {
        public string prodCode { get; set; }
        public string lineCode { get; set; }
        public string pcbSurface { get; set; }
        public string moCode { get; set; }
        public string machineCode { get; set; }
    }
}
Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs
@@ -54,5 +54,10 @@
    public class SmtLoadingInput : BaseCodeInput
    {
        public int Step { get; set; }
        public string prodCode { get; set; }
        public string lineCode { get; set; }
        public string pcbSurface { get; set; }
        public string moCode { get; set; }
        public string machineCode { get; set; }
    }
}