huangxiaoqiang
2025-01-03 6d97c9dfd51e148ba2f97114f18889871c278fa6
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_BZ/CommonConveyorLine_BZJob.cs
@@ -193,7 +193,7 @@
        public void RequestOutbound(CommonConveyorLine_BZ conveyorLine, ConveyorLineTaskCommand_After command, Dt_StationManager station)
        {
            //查询对应产线的在途数据
            dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == station.productLine);
            dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == station.productLine && x.toArea == station.stationChildCode);
            needBarcode.inLineNum = _taskRepository.QueryData(x => x.TargetAddress == station.stationChildCode).Count();
@@ -221,15 +221,15 @@
            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;
@@ -254,10 +254,23 @@
                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.ToJsonString()).Result;
                ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, station.stationNGChildCode, station.stationChildCode);
                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);
                    }
                }
            }
        }
    }
}