我的配料修改
This commit is contained in:
@@ -29,5 +29,7 @@ namespace ZR.Service.mes.mm.IService
|
||||
string AGV_schedule(string start_point, string end_point);
|
||||
string EmergencyStopAgv(string reqCode);
|
||||
|
||||
int FinishBatchingTask(string start_point, string end_point, string taskId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +160,7 @@ namespace ZR.Service.mes.mm
|
||||
ingredientTask.TaskId = taskid.ToString();
|
||||
ingredientTask.Workorder = item.workorder;
|
||||
ingredientTask.Partnumber = item.partnumber;
|
||||
ingredientTask.Isfinal = 0;
|
||||
ingredientTask.PreviousNumber = item.previousNumber;
|
||||
ingredientTask.PreviousNumbered = item.previousNumbered;
|
||||
ingredientTask.CreatedBy = name;
|
||||
@@ -189,6 +190,7 @@ namespace ZR.Service.mes.mm
|
||||
DateTime endOfDay = startOfDay.AddDays(1).AddTicks(-1);
|
||||
return Context.Queryable<MmIngredientTask>()
|
||||
.Where(it => it.CreatedTime > startOfDay && it.CreatedTime < endOfDay)
|
||||
.Where(it => it.Isfinal == 0)
|
||||
.GroupBy(it => it.TaskId)
|
||||
.Select(it => new MmIngredientTask()
|
||||
{
|
||||
@@ -217,8 +219,8 @@ namespace ZR.Service.mes.mm
|
||||
/// <returns></returns>
|
||||
public string[] Getfabgopoints()
|
||||
{
|
||||
return Context.Queryable<MmAgvLocation>().Where(it => it.AreaCode == 3).Where(it => it.Status == 0)
|
||||
.Select(it => it.Coordinate).ToArray();
|
||||
return Context.Queryable<MmAgvLocation>().Where(it => it.AreaCode == 3).Where(it => it.Status == 0)
|
||||
.Select(it => it.Coordinate).ToArray();
|
||||
|
||||
}
|
||||
|
||||
@@ -230,7 +232,7 @@ namespace ZR.Service.mes.mm
|
||||
/// <param name="start_point"></param>
|
||||
/// <param name="end_point"></param>
|
||||
/// <returns></returns>
|
||||
public string AGV_schedule(string start_point, string end_point)
|
||||
public string AGV_schedule(string start_point, string end_point)
|
||||
{
|
||||
string url = "https://192.168.60.1:443/rcms/services/rest/hikRpcService/genAgvSchedulingTask";
|
||||
AGVtask_third task = new AGVtask_third();
|
||||
@@ -256,7 +258,7 @@ namespace ZR.Service.mes.mm
|
||||
|
||||
string postData = JsonSerializer.Serialize(task);
|
||||
string response = HttpHelper.HttpPost(url, postData);
|
||||
|
||||
|
||||
|
||||
return response;
|
||||
|
||||
@@ -285,6 +287,25 @@ namespace ZR.Service.mes.mm
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 完成配料任务
|
||||
/// 1.更改站点托盘
|
||||
/// 2.完成的配料任务不可见
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int FinishBatchingTask(string start_point, string end_point, string taskId)
|
||||
{
|
||||
int result = 0;
|
||||
UseTran2(() =>
|
||||
{
|
||||
Context.Updateable<MmAgvLocation>().Where(it => it.Coordinate == start_point).SetColumns(it => it.Status == 0).ExecuteCommand();
|
||||
Context.Updateable<MmAgvLocation>().Where(it => it.Coordinate == end_point).SetColumns(it => it.Status == 1).ExecuteCommand();
|
||||
result= Context.Updateable<MmIngredientTask>().Where(it => it.TaskId.Equals(taskId)).SetColumns(it => it.Isfinal == 1).ExecuteCommand();
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user