| | |
| | | // 处理 stationType 为 7 的情况 |
| | | private async Task<WebResponseContent> HandleStationType7(string palletCode, Dt_StationManager stationManager) |
| | | { |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway == stationManager.Roadway); |
| | | var runTask = await BaseDal.QueryFirstAsync(x => x.CurrentAddress == station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray); |
| | | |
| | | if (runTask != null) |
| | |
| | | // 处理 stationType 为 6 的情况 |
| | | private async Task<WebResponseContent> HandleStationType6(string palletCode, Dt_StationManager stationManager) |
| | | { |
| | | var emptyStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); |
| | | var emptyStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway==stationManager.Roadway); |
| | | var runTask = await BaseDal.QueryFirstAsync(x => x.NextAddress == emptyStation.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray); |
| | | |
| | | if (runTask != null) |
| | |
| | | var wmsIpAddress = wmsBase + completeTask; |
| | | |
| | | var result = HttpHelper.GetAsync(wmsIpAddress, keys).Result; |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Data.IsNullOrEmpty()) |
| | | { |
| | | if (content.Data.ToString() == "NG") |
| | | { |
| | | task.Remark = "NG"; |
| | | //BaseDal.UpdateData(task); |
| | | //_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成,MOM返回NG"); |
| | | } |
| | | } |
| | | task.ExceptionMessage += " " + content.Message; |
| | | |
| | | QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(result)}】{Environment.NewLine}{Environment.NewLine}"); |
| | | if(result != null) |
| | | { |
| | | |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Data.IsNullOrEmpty()) |
| | | { |
| | | if (content.Data.ToString() == "NG") |
| | | { |
| | | task.Remark = "NG"; |
| | | //BaseDal.UpdateData(task); |
| | | //_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成,MOM返回NG"); |
| | | } |
| | | } |
| | | task.ExceptionMessage += " " + content.Message; |
| | | |
| | | } |
| | | #endregion WMS同步任务完成 |
| | | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | |
| | | else |
| | | { |
| | | var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList(); |
| | | if (GWTask.Count >= 2 && childDeviceCode == "1039") |
| | | if (GWTask.Count >= 2 && childDeviceCode == "1039"&& task.Roadway.Contains("GWSC2")) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发"); |
| | | return; |
| | |
| | | //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, command.ConveyorLineBarcode, childDeviceCode); |
| | | var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList(); |
| | | if (GWTask.Count >= 2 && childDeviceCode == "1039") |
| | | if (GWTask.Count >= 2 && childDeviceCode == "1039"&&task.Roadway.Contains("GWSC2")) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发"); |
| | | return; |
| | |
| | | methods: { |
| | | //下面这些方法可以保留也可以删除 |
| | | onInit() { |
| | | // this.$Notice.success({ title: this.detailOptions.cnName + ',查询结果', desc: '返回的对象:' + JSON.stringify(data) }); |
| | | |
| | | // this.$Notice.success({ title: this.detailOptions.cnName + ',查询结果', desc: '返回的对象:' + JSON.stringify(data) }); |
| | | var previousButton = this.buttons.find((x) => x.value == "Previous"); |
| | | if (previousButton) previousButton.hidden = true; |
| | | var nextButton = this.buttons.find((x) => x.value == "Next"); |
| | |
| | | methods: { |
| | | //下面这些方法可以保留也可以删除 |
| | | onInit() { |
| | | |
| | | this.columns.forEach(x => { |
| | | if (x.field == "errorMessage") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | if (row.errorMessage == null||row.errorMessage=="") { |
| | | return { background: "White", color: "Black" } |
| | | } |
| | | else{ |
| | | return { background: "#FF4500", color: "Black" } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | //框架初始化配置前, |
| | | let TaskHandCompleteBtn=this.buttons.find(x=>x.value=='TaskHandComplete'); |
| | | if(TaskHandCompleteBtn){ |
| | |
| | | { field: 'targetAddress', title: '目标位置', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'grade', title: '优先级', type: 'int', width: 60, align: 'left' }, |
| | | { field: 'productionLine', title: '产线', type: 'string', width: 70, align: 'left', bind: { key: "ProductionLine", data: [] } }, |
| | | { field: 'processCode', title: '工序', type: 'string', width: 90, align: 'left' }, |
| | | { field: 'errorMessage', title: '异常信息', type: 'string', width: 110, align: 'left',sort: true }, |
| | | { field: 'dispatchertime', title: '任务下发时间', type: 'datetime', width: 150, align: 'left', sort: true }, |
| | | { field: 'remark', title: '备注', type: 'string', width: 110, align: 'left',hidden: true, }, |
| | | { field: 'createDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, |
| | |
| | | { field: 'locationCode', title: '货位号', type: 'string', width: 110, hidden: true, align: 'left' }, |
| | | { field: 'materialNo', title: '物料编号', type: 'string', width: 110, hidden: true, align: 'left' }, |
| | | { field: 'targetAddress', title: '目标地址', type: 'string', width: 110, hidden: true, align: 'left' }, |
| | | { field: 'processCode', title: '工序', type: 'string', width: 90, align: 'left' }, |
| | | { field: 'createID', title: '创建ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' }, |
| | | { field: 'modifyID', title: '修改人ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },]); |
| | | const detail = ref({ |
| | |
| | | { field: 'nextAddress', title: '下一位置', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'targetAddress', title: '目标位置', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'grade', title: '优先级', type: 'int', width: 60, align: 'left' }, |
| | | { field: 'productionLine', title: '产线', type: 'string', width: 70, align: 'left', bind: { key: "ProductionLine", data: [] } }, |
| | | { field: 'processCode', title: '工序', type: 'string', width: 90, align: 'left' }, |
| | | { field: 'productionLine', title: '产线', type: 'string', width: 70, align: 'left', bind: { key: "ProductionLine", data: [] } }, |
| | | { field: 'errorMessage', title: '异常信息', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'dispatchertime', title: '任务下发时间', type: 'datetime', width: 150, align: 'left', sort: true }, |
| | | { field: 'operateType', title: '操作类型', type: 'string', width: 110, align: 'left', bind: { key: "operateType", data: [] }}, |
| | | { field: 'remark', title: '备注', type: 'string', width: 110, align: 'left',hidden: true, }, |
| | |
| | | { field: 'modifier', title: '修改人', type: 'string', sort: true, width: 100, align: 'left' }, |
| | | { field: 'locationCode', title: '货位号', type: 'string', width: 110, hidden: true, align: 'left' }, |
| | | { field: 'materialNo', title: '物料编号', type: 'string', width: 110, hidden: true, align: 'left' }, |
| | | { field: 'targetAddress', title: '目标地址', type: 'string', width: 110, hidden: true, align: 'left' }, |
| | | { field: 'processCode', title: '工序', type: 'string', width: 90, align: 'left' }, |
| | | { field: 'createID', title: '创建ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' }, |
| | | { field: 'modifyID', title: '修改人ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },]); |
| | | const detail = ref({ |
| | |
| | | LogFactory.GetLog("分容测试完成通知").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("分容测试完成通知").Info(true, result.ToJsonString()); |
| | | |
| | | var location = _locationRepository.QueryFirst(x => x.AreaId == result.LocationArea && x.LocationCode == result.LocationID); |
| | | var location = _locationRepository.QueryFirst(x => x.AreaId == result.LocationArea && x.LocationCode == result.LocationID && x.EnalbeStatus == 1); |
| | | |
| | | if (location == null) throw new Exception("未知库位"); |
| | | |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + ipAddress; |
| | | |
| | | var result = HttpsClient.PostAsync(wmsIpAddress, inputJson).Result; |
| | | var result =await HttpsClient.PostAsync(wmsIpAddress, inputJson); |
| | | content.OK(data: result); |
| | | |
| | | var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.ToString()); |
| | |
| | | var isStockUpdated = await _locationRepository.UpdateDataAsync(info); |
| | | if (!isStockUpdated) |
| | | { |
| | | throw new Exception("库存信息更新失败"); |
| | | throw new Exception("库位信息更新失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.InNG || task.TaskType == (int)TaskInboundTypeEnum.InQuality) |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.InNG) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.SC_InFinish; |
| | | // 创建历史任务实例模型 |
| | |
| | | Console.WriteLine(err.Message.ToString()); |
| | | LogFactory.GetLog("任务完成").Error(true, err); |
| | | content.Error(err.Message); |
| | | task.ErrorMessage= err.Message; |
| | | task.TaskState=(int)TaskInStatusEnum.SC_InExecuting; |
| | | await BaseDal.Update(task); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | // TODO 判断在途数量 |
| | | |
| | | var needBarcode = await SqlSugarHelper.DbWCS.Queryable<dt_needBarcode>().FirstAsync(x => x.productLine == STATION.productLine && x.fromArea == "CW"); |
| | | var needCount = needBarcode.inLineNum = BaseDal.QueryData(x => x.TargetAddress == STATION.stationChildCode).Count(); |
| | | var needCount = BaseDal.QueryData(x => x.TargetAddress == needBarcode.toArea).Count(); |
| | | //var count = BaseDal.QueryData(x => x.TargetAddress == stationManagers[0].Roadway).Count; |
| | | if (needCount < needBarcode.cacheNum) |
| | | { |