| | |
| | | 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> |
| | |
| | | /// </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()) |
| | |
| | | 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() |
| | |
| | | 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) |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | return action; |
| | | } |
| | | |
| | | private ApiAction ExecuteFeeder() |
| | | private ApiAction ExecuteFeeder(SmtLoadingInput input) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | |
| | | return action; |
| | | } |
| | | |
| | | private ApiAction ExecuteSN() |
| | | private ApiAction ExecuteSN(SmtLoadingInput input) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |