| | |
| | | } |
| | | if (jkloction.Count > 0) |
| | | { |
| | | #region 记录上料请求信号 |
| | | WriteLog.GetLog().Write($"{locNum}上料请求---{DateTime.Now}", $"切卷上料请求"); |
| | | #endregion |
| | | //再次判断是否有任务存在 |
| | | dt_agvtask agvtaskOld = agvRepository.FindFirst(x=>x.agv_toaddress== location_QJ.upper_code); |
| | | if (agvtaskOld!=null && location_QJ.task==2) |
| | | { |
| | | location_QJ.logic_col = 1;//设置良品物料 |
| | | location_QJ.task = 1;//设置任务生成1 |
| | | var ent = ibase_Ware_Location.DbContext.ChangeTracker.Entries<base_ware_location>().FirstOrDefault(); |
| | | if (ent != null) |
| | | { |
| | | ent.State = EntityState.Detached; |
| | | } |
| | | ibase_Ware_Location.Update(location_QJ, true); |
| | | return content.Error("改缓存架任务已存在"); |
| | | } |
| | | base_ware_location lotion = jkloction.OrderBy(d => d.update_time).FirstOrDefault(); |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | | { |
| | |
| | | if (be==1&& dw==1) |
| | | { |
| | | agvRepository.Add(agvtask, true);//任务生成 |
| | | WriteDBLog.Info($"切卷按钮任务生成").Write($"生成任务:{agvtask.agv_tasknum}", $"切卷按钮任务生成"); |
| | | WriteDBLog.Info($"切卷按钮任务生成").Write($"起点货位【{lotion.upper_code}】状态:托盘光电检测:{lotion.tpgd},状态:{lotion.location_state},更新时间:{lotion.wireless_time}", $"切卷按钮任务生成"); |
| | | WriteDBLog.Info($"切卷按钮任务生成").Write($"终点货位【{location_QJ.upper_code}】状态:托盘光电检测:{location_QJ.tpgd},-1光电:{location_QJ.gd2},-2光电:{location_QJ.gd1},-3光电:{location_QJ.gd4},-4光电:{location_QJ.gd3},状态:{location_QJ.location_state},更新时间:{location_QJ.wireless_time}", $"切卷按钮任务生成"); |
| | | WriteDBLog.Info($"切卷按钮任务生成").Write($"----------------任务生成成功 {DateTime.Now} -------------- {Environment.NewLine}", $"切卷按钮任务生成"); |
| | | //WriteDBLog.Info($"切卷按钮任务生成").Write($"生成任务:{agvtask.agv_tasknum}", $"切卷按钮任务生成"); |
| | | //WriteDBLog.Info($"切卷按钮任务生成").Write($"起点货位【{lotion.upper_code}】状态:托盘光电检测:{lotion.tpgd},状态:{lotion.location_state},更新时间:{lotion.wireless_time}", $"切卷按钮任务生成"); |
| | | //WriteDBLog.Info($"切卷按钮任务生成").Write($"终点货位【{location_QJ.upper_code}】状态:托盘光电检测:{location_QJ.tpgd},-1光电:{location_QJ.gd2},-2光电:{location_QJ.gd1},-3光电:{location_QJ.gd4},-4光电:{location_QJ.gd3},状态:{location_QJ.location_state},更新时间:{location_QJ.wireless_time}", $"切卷按钮任务生成"); |
| | | //WriteDBLog.Info($"切卷按钮任务生成").Write($"----------------任务生成成功 {DateTime.Now} -------------- {Environment.NewLine}", $"切卷按钮任务生成"); |
| | | return content.OK("呼叫成功,任务已记录", 1); |
| | | } |
| | | } |