From c667629f6f7b9cdb15958fc560bd2bf83f36cdf6 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 24 12月 2024 11:33:42 +0800
Subject: [PATCH] 22
---
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/4、DataProcess_RobotBuffer_ForceOutbound.cs | 73 ++++++++++++++++++++----------------
1 files changed, 41 insertions(+), 32 deletions(-)
diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/4\343\200\201DataProcess_RobotBuffer_ForceOutbound.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/4\343\200\201DataProcess_RobotBuffer_ForceOutbound.cs"
index 1de3997..18d745c 100644
--- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/4\343\200\201DataProcess_RobotBuffer_ForceOutbound.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/4\343\200\201DataProcess_RobotBuffer_ForceOutbound.cs"
@@ -1,10 +1,12 @@
锘縰sing Admin.NET.Application;
+using iWareCC.Common.Helper;
using iWareCommon.Common.Globle;
using iWareCommon.Utils;
using iWareModel;
using iWareSql.DataAccess;
using iWareSql.WmsDBModel;
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
@@ -47,49 +49,56 @@
List<wms_stock_quan> qunList = wmsDB.wms_stock_quan.Where(x => x.StockStatus == (int)StockStatusEnum.浜哄伐寮哄埗寰呭嚭搴�
).OrderBy(x => x.PackageCode).ToList();
- foreach (var x in qunList)
+ //鎸夌収鍖呭垎缁勫鐞�
+ var groups = qunList.GroupBy(x => x.PackageCode);
+ foreach (var group in groups)
{
- x.StockStatus = (int)StockStatusEnum.浜哄伐寮哄埗浠诲姟宸插垱寤�;
- x.StockStatusName = StockStatusEnum.浜哄伐寮哄埗浠诲姟宸插垱寤�.ToString();
+ //娉ㄦ剰锛氭帓搴忎弗鏍兼寜鐓� 娆″簭 杩涜鎺掑簭銆� 锛侊紒锛侊紒锛侊紒锛侊紒
+ var stockList = group.ToList().OrderBy(x => x.Shelf).ToList();
- //鐢熸垚鍑哄簱浠诲姟
- //璁板綍浠诲姟
- var _id = Yitter.IdGenerator.YitIdHelper.NextId();
- var plcTaskNo = BusinessHelper.CreatePlcTaskIdForSrmTask();
- var new_task = new wms_rbline_task()
+ foreach (var x in stockList)
{
- Id = _id,
- TaskNo = plcTaskNo,
+ x.StockStatus = (int)StockStatusEnum.浜哄伐寮哄埗浠诲姟宸插垱寤�;
+ x.StockStatusName = StockStatusEnum.浜哄伐寮哄埗浠诲姟宸插垱寤�.ToString();
- Upi = x.Upi,
- Length = x.Length,
- Width = x.Width,
- Thk = x.Thk,
+ //鐢熸垚鍑哄簱浠诲姟
+ //璁板綍浠诲姟
+ var _id = Yitter.IdGenerator.YitIdHelper.NextId();
+ var plcTaskNo = BusinessHelper.CreatePlcTaskId();
+ plcTaskNo = MyExtendHelper.GetNewTaskNo(wmsDB, RbTaskTypeEnum.寮哄埗鍑哄簱浠诲姟, plcTaskNo);
+ var new_task = new wms_rbline_task()
+ {
+ Id = _id,
+ TaskNo = plcTaskNo,
- PlanNo = x.PlanNo,
- OrderId = x.OrderId,
- PackageCode = x.PackageCode,
- PlaceCode = x.PlaceCode,
- RbTaskType = (int)RbTaskTypeEnum.寮哄埗鍑哄簱浠诲姟,
- TaskStatus = (int)TaskStatusEnum.鏂板缓,
- TaskMsg = "浜哄伐寮哄埗寰呭嚭搴�",
+ Upi = x.Upi,
+ Length = x.Length,
+ Width = x.Width,
+ Thk = x.Thk,
+
+ PlanNo = x.PlanNo,
+ OrderId = x.OrderId,
+ PackageCode = x.PackageCode,
+ PlaceCode = x.PlaceCode,
+ RbTaskType = (int)RbTaskTypeEnum.寮哄埗鍑哄簱浠诲姟,
+ TaskStatus = (int)TaskStatusEnum.鏂板缓,
+ TaskMsg = "浜哄伐寮哄埗寰呭嚭搴�",
- CreateTime = DateTime.Now,
- CreateUserName = "CC",
- UpdateTime = DateTime.Now,
- UpdateUserName = "CC",
- };
+ CreateTime = DateTime.Now,
+ CreateUserName = SysGloble.WCSSystem,
+ UpdateTime = DateTime.Now,
+ UpdateUserName = SysGloble.WCSSystem,
+ };
- wmsDB.wms_rbline_task.Add(new_task);
+ wmsDB.wms_rbline_task.Add(new_task);
- var place = StationHandler.GetPlaceByPlaceCode(x.PlaceCode, wmsDB);
- place.PlaceStatus = (int)PlaceStatusEnum.閿佸畾;
+ var place = StationHandler.GetPlaceByPlaceCode(x.PlaceCode, wmsDB);
+ place.PlaceStatus = (int)PlaceStatusEnum.閿佸畾;
- Thread.Sleep(100);
+ Thread.Sleep(100);
+ }
}
-
-
wmsDB.SaveChanges();
}
--
Gitblit v1.9.3