3 Revize 62a7ea5abf ... 7d11b2426d

Autor SHA1 Zpráva Datum
  莫海杰 7d11b2426d 提交 před 3 měsíci
  莫海杰 e96833a10c 提交 před 3 měsíci
  莫海杰 41f54304ca TIJIAO před 3 měsíci

+ 1 - 1
SCADA_DAQ/Customer/Service/Wcs_WebInventoryService.cs

@@ -158,7 +158,7 @@ namespace SCADA_DAQ.Customer.Service
                     row,
                     t => new { t.SourceLocation, t.ItemCode, t.WarehouseCode },
                     null,
-                    t => new { t.ItemName, t.Qty, t.UnitCode, t.Remark }
+                    t => new { t.ItemName, t.Qty, t.UnitCode, t.Remark, t.LocationName }
                 );
             return new RpcResponse<object>()
             {

+ 37 - 19
SCADA_DAQ/Customer/Service/Wcs_WmsService.cs

@@ -369,7 +369,7 @@ namespace SCADA_DAQ.Customer.Service
                             ErrorMsg = wmsRes.Result.Error
                         });
                     }
-                    
+                    // wmsRes.Success == true && wmsRes.Result.IsSuccess == true
                     if (wmsRes.Success == true && wmsRes.Result.IsSuccess == true)
                     {
                         message = $@"{message} {task[i].TaskNo}上传成功";
@@ -388,7 +388,7 @@ namespace SCADA_DAQ.Customer.Service
             var updateSumItemQtyList = new List<AppBCInventoryModel>();
             #region /完成任务更新库存数量逻辑
             var successItemTaskQtyList = successItemTaskQty.ToLookup(t => new { t.ItemCode, t.SourceLocation, t.WarehouseCode }).ToList();
-            string inventoryFilter = null;
+            string inventoryFilter = "ID = 0";
             foreach (var itemTaskQtyValues in successItemTaskQtyList)
             {
                 foreach (var itemTaskQtyValue in itemTaskQtyValues)
@@ -416,7 +416,7 @@ namespace SCADA_DAQ.Customer.Service
             //以上foreach为了将相同物料,库区,库位的数量相加
             for (int j = 0; j < updateSumItemQtyList.Count; j++)
             {
-                if (inventoryFilter == null)
+                if (inventoryFilter == "ID = 0")
                 {
                     inventoryFilter = $" (ItemCode_Str = '{updateSumItemQtyList[j].ItemCode}' and SourceLocation_Str = '{updateSumItemQtyList[j].SourceLocation}' and WarehouseCode_Str = '{updateSumItemQtyList[j].WarehouseCode}') ";
                 }
@@ -478,6 +478,23 @@ namespace SCADA_DAQ.Customer.Service
             var endLine2 = 3;
             foreach (var item in sourceLocationGroupBy)
             {
+                // 单个任务传来
+                if (CustomerEnv.OperationCrane1List.Where(t => t.EndRow == 1).Count() <= CustomerEnv.OperationCrane1List.Where(t => t.EndRow == 2).Count())
+                {
+                    endLine1 = 1;
+                }
+                if (CustomerEnv.OperationCrane1List.Where(t => t.EndRow == 1).Count() > CustomerEnv.OperationCrane1List.Where(t => t.EndRow == 2).Count())
+                {
+                    endLine1 = 2;
+                }
+                if (CustomerEnv.OperationCrane2List.Where(t => t.EndRow == 3).Count() <= CustomerEnv.OperationCrane2List.Where(t => t.EndRow == 4).Count())
+                {
+                    endLine2 = 3;
+                }
+                if (CustomerEnv.OperationCrane2List.Where(t => t.EndRow == 3).Count() > CustomerEnv.OperationCrane2List.Where(t => t.EndRow == 4).Count())
+                {
+                    endLine2 = 4;
+                }
                 var sourceLocation = item.SourceLocation.Split('-');
                 var crane = 2;
                 var endCol = 65;
@@ -504,22 +521,23 @@ namespace SCADA_DAQ.Customer.Service
                     ItemCode = item.ItemCode,
                     ItemName = item.ItemName,
                 });
-                if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 1)
-                {
-                    endLine1 = 2; 
-                }
-                else if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 2)
-                {
-                    endLine1 = 1;
-                }
-                if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 3)
-                {
-                    endLine2 = 4;
-                }
-                else if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 4)
-                {
-                    endLine2 = 3;
-                }
+                // 多个任务传来
+                //if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 1)
+                //{
+                //    endLine1 = 2;
+                //}
+                //else if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 2)
+                //{
+                //    endLine1 = 1;
+                //}
+                //if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 3)
+                //{
+                //    endLine2 = 4;
+                //}
+                //else if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 4)
+                //{
+                //    endLine2 = 3;
+                //}
             }
             var operationCrane1List = sourceLocationList.Where(i => i.Crane == 1).ToList();
             var operationCrane2List = sourceLocationList.Where(i => i.Crane == 2).ToList();