| | |
| | | { |
| | | OperInfoDic.Add(CurBatch.Batch.BATCH_NO, new()); |
| | | } |
| | | |
| | | |
| | | action.Data = new { WorkOrder = CurBatch.WO, Bacth = CurBatch.Batch }; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | OperInfo info = new(); |
| | | if (CurBatch?.Batch?.BATCH_NO != null) |
| | | { |
| | | info = OperInfoDic[CurBatch.Batch.BATCH_NO ]; |
| | | info = OperInfoDic[CurBatch.Batch.BATCH_NO]; |
| | | info.StepsInfo = Steps.Select(q => q.GetInfo(locale)).ToList(); |
| | | } |
| | | return info; |
| | |
| | | if (CurStep.IsFinished && NextSteps.Any()) |
| | | { |
| | | result = BeginNextActionStep(input); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //返回结果到客户端 |
| | | result = canBegin; |
| | | result.Data.SetValue(CurBatch, CurStep, CurStep?.ID, IsFinishAllSteps); |
| | | //返回结果到客户端 |
| | | result = canBegin; |
| | | result.Data.SetValue(CurBatch, CurStep, CurStep?.ID, IsFinishAllSteps); |
| | | } |
| | | return result; |
| | | } |
| | | //工序被重置 |
| | | else if(Steps.IsNullOrEmpty()) |
| | | else if (Steps.IsNullOrEmpty()) |
| | | { |
| | | return canBegin; |
| | | } |
| | |
| | | return WorkBatch.Product.ToJson(); |
| | | case "GetCustomer": |
| | | return WorkBatch.Batch.ToJson(); |
| | | case "GetModel": |
| | | return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Model); |
| | | case "GetInput": |
| | | return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Input); |
| | | case "GetOutput": |
| | | return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.OutPut); |
| | | case "GetPower": |
| | | return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Power); |
| | | case "GetAccuracy": |
| | | return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Accuracy); |
| | | case "GetVarByWo": |
| | | return GetLabelVarWo(lv); |
| | | return GetLabelVarWo(lv, ""); |
| | | default: |
| | | return ""; |
| | | } |
| | |
| | | case "GetCartonGenerate": |
| | | return Biz.CodeRule[lv.BARCODE_RULE ?? ""]?.Generate($"{WorkBatch.Batch.BATCH_NO}-{WorkBatch.Batch.PLAN_QTY}-").Data.ToString() ?? ""; |
| | | case "GetHW21SNGenerate": |
| | | return Biz.CodeRule[lv.BARCODE_RULE ?? ""]?.Generate("SN:","05").Data.ToString() ?? ""; |
| | | return Biz.CodeRule[lv.BARCODE_RULE ?? ""]?.Generate("SN:", "05").Data.ToString() ?? ""; |
| | | default: |
| | | return ""; |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="labelId"></param> |
| | | /// <returns></returns> |
| | | private string GetLabelVarWo(BAS_LABEL_VAR lv) |
| | | private string GetLabelVarWo(BAS_LABEL_VAR lv, string value) |
| | | { |
| | | string result = ""; |
| | | var labelVarwos = Biz.Db.Queryable<BAS_LABEL_VAR_WO>().Where(x => x.LABEL_ID == lv.LABEL_ID && x.VAR_NAME == lv.VAR_NAME).ToList(); |
| | |
| | | } |
| | | else |
| | | { |
| | | result = labelVarwos.Count > 0 ? labelVarwos[0].DEFAULT_VALUE : ""; |
| | | result = value.IsNullOrEmpty() ? (labelVarwos.Count > 0 ? labelVarwos.First().DEFAULT_VALUE : "") : value; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | int year = date.Year + ((date - firstDay).TotalDays + daysOffset < 0 ? -1 : 0); |
| | | int week = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Sunday); |
| | | dic.Add(sn, $"{year.ToString().Substring(2, 2)}{week:00}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | dic.Add(sn, ""); |