From 829eabf256e29392ca63f6da48829dba3b075dfe Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期五, 24 一月 2025 08:59:53 +0800
Subject: [PATCH] 资料,优化程序
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 55 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 14 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index fe7d87e..60367bd 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -22,6 +22,7 @@
using Org.BouncyCastle.Asn1.Tsp;
using SqlSugar;
using System;
+using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
@@ -80,13 +81,13 @@
_taskHtyService = taskHtyService;
_locationInfoService = locationInfoService;
}
-
+ public string ReceiveWCSTask = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWCSTask"];
/// <summary>
/// 浠诲姟瀹屾垚
/// </summary>
/// <param name="taskNum">浠诲姟鍙�</param>
/// <returns>杩斿洖澶勭悊缁撴灉</returns>
- public WebResponseContent TaskCompleted(int taskNum)
+ public WebResponseContent TaskCompleted(int taskNum,int HowWorks)
{
try
{
@@ -94,6 +95,10 @@
if (task == null)
{
return WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
+ }
+ if (HowWorks == 1)
+ {
+ WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎");
}
MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCompleted");
if (methodInfo != null)
@@ -126,9 +131,14 @@
Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
//鏌ヨ揣浣�
Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
- Dt_StockInfoDetail dt_StockInfodetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.OrderNo == task.PalletCode);
+ Dt_StockInfoDetail dt_StockInfodetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id);
CheckCompleted(stockInfo, locationInfo);
+ if (stockInfo.MaterialType == (int)InventoryMaterialType.绌烘墭)
+ {
+ string currentTime = DateTime.Now.ToString("HHmmss");
+ stockInfo.PalletCode = "KTP" + currentTime;
+ }
stockInfo.LocationCode = task.TargetAddress;
stockInfo.StockStatus = StockStatusEmun.宸插叆搴�.ObjToInt();
_stockService.StockInfoService.Repository.UpdateData(stockInfo);
@@ -141,7 +151,14 @@
beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
int beforeStatus = locationInfo.LocationStatus;
- locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+ if (stockInfo.MaterialType == (int)InventoryMaterialType.绌烘墭)
+ {
+ locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
+ }
+ else
+ {
+ locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+ }
_basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
_basicService.LocationInfoService.Repository.UpdateData(locationInfo);
@@ -207,10 +224,10 @@
return (false, "鏈壘鍒拌揣浣嶄俊鎭�");
}
- if (isCheckStockDetail && (stockInfo.Details == null || stockInfo.Details.Count == 0))
+ /*if (isCheckStockDetail && (stockInfo.Details == null || stockInfo.Details.Count == 0))
{
return (false, "鏈壘鍒扮粍鐩樻槑缁嗕俊鎭�");
- }
+ }*/
return (true, "鎴愬姛");
}
@@ -227,22 +244,30 @@
stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
_stockService.StockInfoService.Repository.UpdateData(stockInfo);
int beforeStatus = locationInfo.LocationStatus;
- if (task.Depth == 1)
+ /*if (task.Depth == 1)
{
- if (DepthTask(task)) { }
+ *//*if (DepthTask(task))
+ {
+ }
else
{
locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
_basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false);
_basicService.LocationInfoService.Repository.UpdateData(locationInfo);
- }
+ }*//*
+ locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+ _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false);
+ _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
}
else
{
locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
_basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false);
_basicService.LocationInfoService.Repository.UpdateData(locationInfo);
- }
+ }*/
+ locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+ _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false);
+ _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt();
BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
@@ -285,12 +310,12 @@
return WebResponseContent.Instance.OK();
}
- public WebResponseContent RelocationTaskCompleted(GenerateInv2 generate)
+ public WebResponseContent RelocationInTaskCompleted(Dt_Task task)
{
- Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(generate.PalletCode);
+ Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
- Dt_LocationInfo locationpoint = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == generate.SourceAddress);
- Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == generate.TargetAddress);
+ Dt_LocationInfo locationpoint = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+ Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>();
stockInfo.LocationCode = locationEnd.LocationCode;
@@ -328,5 +353,7 @@
}
return false;
}
+
+
}
}
--
Gitblit v1.9.3