using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm.TaskNo;
using WIDESEA_Comm;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WMS.IRepositories;
namespace WIDESEA_WCS.JobsPart.Common
{
public class AGVTask
{
///
/// 添加AGV入库队列任务
///
///
///
///
///
///
public static void AddQueueTask(Idt_stationinfoRepository stationinfoRepository, Idt_agvtaskRepository agvtaskRepository, dt_stationinfo stationinfo, string tasktype, VV_Mes_Workinfo work)
{
#region 添加AGV队列任务
dt_agvtask agvtask = new dt_agvtask()
{
agv_fromaddress = stationinfo.stationCode,
agv_id = Guid.NewGuid(),
agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
agv_grade = 2,
agv_createtime = DateTime.Now,
agv_taskstate = "Queue",
agv_materielid = stationinfo.stationType,
agv_qty = stationinfo.quantity,
agv_tasktype = tasktype,
//agv_toaddress = TargetLocation.stationCode,
agv_toaddress = "",
agv_userid = "系统",
bindSN = stationinfo.bindSN,
agv_worktype = Convert.ToInt32(work.processCode),
agv_materbarcode = work.materialCode,
agv_Traytype = stationinfo.tray_type,
jobID = stationinfo.Number,
agv_TrayStatus = stationinfo.tray_status
};
agvtaskRepository.Add(agvtask, true);
stationinfo.location_state = LocationStateEnum.InBusy.ToString();
stationinfoRepository.Update(stationinfo, true);
#endregion
}
}
}