| | |
| | | dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.toArea == station.stationChildCode); |
| | | if (needBarcode == null) throw new Exception($"未配置相关{station.stationChildCode}的产线在途数据"); |
| | | |
| | | if (task != null) //如任务不为空 则为送包装料 |
| | | if (task != null) //如任务不为空 则为送包装料 写入下一地址 清除对应任务 并更新在途数据 |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, station.stationChildCode); |
| | | _taskRepository.DeleteData(task); |
| | | |
| | | needBarcode.inLineNum--; |
| | | if (needBarcode.inLineNum-- <= 0) needBarcode.inLineNum = 0; |
| | | _needBarcodeRepository.UpdateData(needBarcode); |
| | | } |
| | | else |
| | | else //如无任务 则判定为从NG口上料 调取MOM接口 判断返回参数 无异常则送入包装,有异常则退回NG口 |
| | | { |
| | | var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.MOMIP_BASE)?.ConfigValue; |
| | |
| | | var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.ToJsonString()).Result; |
| | | ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result); |
| | | |
| | | if (!result1.Success) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, station.stationNGChildCode, station.stationChildCode); |
| | | } |
| | | |
| | | |
| | | else |
| | | { |
| | | //写入对应产线目标地址 |
| | | if (station.productLine == "ZJ-7") |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, "", station.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, "", station.stationChildCode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |