change-出库绑定箱壳内胆从数据取数据

collectionStore
liuwf 9 months ago
parent 1a8ddc6626
commit 9e467448a6

@ -644,8 +644,8 @@ namespace Aucma.Scada.Business
// taskHandleBusiness.WritePlc(spaceInfo.storeCode, spaceInfo.spaceCode); // taskHandleBusiness.WritePlc(spaceInfo.storeCode, spaceInfo.spaceCode);
//读取PLC获取货道信息存放数量、在途数量 //读取PLC获取货道信息存放数量、在途数量
spaceInfo.spaceStock -= 1; // spaceInfo.spaceStock -= 1;
spaceInfo.outRouteAmount -= 1; // spaceInfo.outRouteAmount -= 1;
#region Add By wenjy 2023-10-30 13:44:00 通过PLC获取货道信息 #region Add By wenjy 2023-10-30 13:44:00 通过PLC获取货道信息
var item = taskHandleBusiness.ReadSpaceInfoByPlc(spaceInfo); var item = taskHandleBusiness.ReadSpaceInfoByPlc(spaceInfo);
@ -678,8 +678,9 @@ namespace Aucma.Scada.Business
RefreshStoreStockEvent?.Invoke(); RefreshStoreStockEvent?.Invoke();
//清除任务信息 //更新任务状态
_taskInfoService.DeleteTaskInfo(taskCode, storeCode); taskInfo.taskStatus = 3;
_taskInfoService.UpdateTaskInfo(taskInfo);
_spaceDetailService.DeleteSpaceDetailByMaterialCode(taskInfo.materialCode); _spaceDetailService.DeleteSpaceDetailByMaterialCode(taskInfo.materialCode);

@ -464,8 +464,8 @@ namespace Aucma.Scada.Business
var item = info[i]; var item = info[i];
ReadLinerFinish_OutStore(item); ReadLinerFinish_OutStore(item);
Console.WriteLine($"内胆任务:{item.taskCode};物料:{item.materialCode};出库完成"); Console.WriteLine($"内胆任务:{item.taskCode};物料:{item.materialCode};出库完成");
item.taskStatus = 3; // item.taskStatus = 3;
linerTaskInfos.Add(item); // linerTaskInfos.Add(item);
} }
} }
@ -483,9 +483,12 @@ namespace Aucma.Scada.Business
{ {
while (true) while (true)
{ {
var shellTasks = shellTaskInfos.Where(x => x.taskStatus == 3).ToList(); //var shellTasks = shellTaskInfos.Where(x => x.taskStatus == 3).ToList();
//var linerTasks = linerTaskInfos.Where(x => x.taskStatus == 3).ToList();
var linerTasks = linerTaskInfos.Where(x => x.taskStatus == 3).ToList(); var shellTasks = GetTaskInfoByTaskStatus(appConfig.shellStoreCode,3);
var linerTasks = GetTaskInfoByTaskStatus(appConfig.linerStoreCode, 3);
RealTaskInfo shellTask = null; RealTaskInfo shellTask = null;
RealTaskInfo linerTask = null; RealTaskInfo linerTask = null;
@ -504,11 +507,14 @@ namespace Aucma.Scada.Business
{ {
Console.WriteLine($"绑定箱壳:{shellTask.materialCode};内胆:{linerTask.materialCode};条码"); Console.WriteLine($"绑定箱壳:{shellTask.materialCode};内胆:{linerTask.materialCode};条码");
_codeBindingRecordServices.BindingCode(shellTask.materialCode, linerTask.materialCode); _codeBindingRecordServices.BindingCode(shellTask.materialCode, linerTask.materialCode);
shellTaskInfos.Remove(shellTask);
linerTaskInfos.Remove(linerTask); _taskInfoService.DeleteTaskInfoById(shellTask.objId);
_taskInfoService.DeleteTaskInfoById(linerTask.objId);
// shellTaskInfos.Remove(shellTask);
// linerTaskInfos.Remove(linerTask);
} }
Thread.Sleep(1000); Thread.Sleep(2000);
} }
}); });

@ -239,6 +239,10 @@ namespace HighWayIot.Repository.service.Impl
exp = exp.And(x => x.taskStatus == taskStatus); exp = exp.And(x => x.taskStatus == taskStatus);
} }
taskInfos = _mesRepository.GetList(exp); taskInfos = _mesRepository.GetList(exp);
if(taskInfos.Count > 0)
{
taskInfos.OrderBy(x => x.beginTime);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save